Re: PHP performance problems with postgres
От | jd@commandprompt.com (Joshua Drake) |
---|---|
Тема | Re: PHP performance problems with postgres |
Дата | |
Msg-id | e60169fc.0109062231.33025946@posting.google.com обсуждение исходный текст |
Список | pgsql-general |
Hello, Stupid question, but are you testing in equal environments. For example, if the Perl script is a CGI is it outputting the same output as PHP. The reason I ask is that if you were using Perl at the command line, it will be faster than PHP. This is because you must wait for your browser to render the data. J jong@theoffice.net (Jon) wrote in message news:<9f131b9a.0109041912.7413e1d9@posting.google.com>... > I'm getting poor performance when querying my postgres database via > php. > > The example table consists of 100,000+ rows of which the query returns > around 6000. > The query is simply "Select * from raw_files where host like $hostname > and timestamp = $timestamp" > > Within perl, this query was taking 45 secs, I then added a two column > index using the hostname and timestamp, and that brought the query > time down to 0.5 sec ;-). > > However, under php I see no improvement with the index. The sql > statement is the same in both cases. I'm using fairly standard > pg_exec, pg_numrows and pg_fetch_array calls, but it still seems to > ignore the index. > > Anyone got any ideas? > > TIA > > Jon.
В списке pgsql-general по дате отправления: