Re: formatting of SQL sent by PHP to postgres

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Ken Guest <kguest(at)stockbyte(dot)com>
Cc: Postgre General <pgsql-general(at)postgresql(dot)org>
Subject: Re: formatting of SQL sent by PHP to postgres
Date: 2003-10-30 15:34:41
Message-ID: Pine.LNX.4.33.0310300832001.23200-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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...

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2003-10-30 15:34:44 Re: slow query performance
Previous Message Jeff MacDonald 2003-10-30 15:29:02 regular backups - super user