Re: PHP performance problems with postgres

From: jd(at)commandprompt(dot)com (Joshua Drake)
To: pgsql-general(at)postgresql(dot)org
Subject: Re: PHP performance problems with postgres
Date: 2001-09-07 06:31:18
Message-ID: e60169fc.0109062231.33025946@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)theoffice(dot)net (Jon) wrote in message news:<9f131b9a(dot)0109041912(dot)7413e1d9(at)posting(dot)google(dot)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.

Browse pgsql-general by date

  From Date Subject
Next Message cnliou 2001-09-07 08:24:09 What Is The Firing Order?
Previous Message Joshua Drake 2001-09-07 06:28:46 Re: running postgresSQL 7 on Linux as postgres user