From: | Mark Morgan Lloyd <markMLl(dot)pgsql-general(at)telemetry(dot)co(dot)uk> |
---|---|
To: | pgsql-general(at)PostgreSQL(dot)org |
Subject: | Re: Delphi connection ? |
Date: | 2009-09-30 08:42:00 |
Message-ID: | h9v5kp$fut$1@pye-srv-01.telemetry.co.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
John R Pierce wrote:
> Nico Callewaert wrote:
>> The thing you always hear about ODBC is, that it is very slow ?
>>
>
>
> ADO is significantly faster than ODBC, so the preferred stack would be
> delphi -> ado -> postgres ole db -> libpq ->postgres
>
> I believe there exists a delphi->ado wrapper (at least my brief googling
> popped one up)
Granted that this is a general query issue rather than one specific to
Delphi/ODBC etc., but the major speed problem that I see is where I have
a clause approximately like
WHERE now() - datetime <= '24 hours'
repeated several times in a query (e.g. in subselects or views). The
easiest solution is to replace this with a function returning an
timestamp which is evaluated once during query execution.
The moral of the story is that even if your queries are wrapped in a
fancy program generated by something like Delphi, always leave yourself
a way that you can extract a representative query after any
parameterisation and do an EXPLAIN to look for inefficiencies.
--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk
[Opinions above are the author's, not those of his employers or colleagues]
From | Date | Subject | |
---|---|---|---|
Next Message | Eduardo Morras | 2009-09-30 08:44:24 | Re: Postgresql Web Hosting |
Previous Message | Mark Morgan Lloyd | 2009-09-30 08:31:05 | Re: Delphi connection ? |