Re: Delphi connection ?
- 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: Wed, 30 Sep 2009 08:42:00 +0000
- Message-id: <h9v5kp$fut$1@pye-srv-01.telemetry.co.uk> <text/plain>
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]
Home |
Main Index |
Thread Index