Re: formatting of SQL sent by PHP to postgres - Mailing list pgsql-general

From scott.marlowe
Subject Re: formatting of SQL sent by PHP to postgres
Date
Msg-id Pine.LNX.4.33.0310300832001.23200-100000@css120.ihs.com
Whole thread Raw
In response to formatting of SQL sent by PHP to postgres  (Ken Guest <kguest@stockbyte.com>)
Responses Re: formatting of SQL sent by PHP to postgres
List pgsql-general
On Thu, 30 Oct 2003, Ken Guest wrote:

> Folks,
> I have a question or two regarding PHP and Postgres on the issue of
> speed:
> 1.    Is the semicolon at the end of SQL superflous when sent to Postgres?
> Should it make much of a difference if I removed it?

Yes, you can get rid of it.  No, it won't make any real difference.

> 2. A lot of SQL issued have white space characters (newlines, tabs and
> spaces) present - does this have any [major] impact on how quick
> postgres gets to execute the SQL and return results?

Other than the very tiny increase in time needed to send the extra blank
spaces across the wire, no, it won't have any real effect on the
performance of the database.

It's far more likely that optimizing your SQL queries will yield the
greatest increase in performance.  Things like replacing "select max(id)
from table" with "select id from table order by id desc limit 1" etc...


pgsql-general by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: Automatic auditing suggestion
Next
From: Tom Lane
Date:
Subject: Re: slow query performance