Re: WHERE 1=2 with performance nightmares
- From: "Craig Stuntz [TeamB]" <craig_stuntz@xxxxxxxxxxxxx [a.k.a. acm.org]>
- Date: 3 Aug 2007 05:50:57 -0700
Del Murray wrote:
I havent ever bothered to see what profiler does with "prepare" but
it would be interesting to see what tdataset says to the database to
"prepare" a sql statment. How could the tdataset possibly get
metadata if it doesn't somehow communicate with the database ?
It depends on the DB API. In the case of IB, a Prepare is one network
hop, but executing a kludgy statment to get precisely the same
information is three (prepare, execute, fetch). Worse, the execute may
have substantial overhead as the server searches for the record you
knew at the outset could never exist. Some other DB APIs may work
differently.
When you prepare only, you don't need the nonsense WHERE clause, and
you can get the metadata information you're asking for. So yes, you do
need to talk to the DB server, but you don't have to blather, as it
were...
--
Craig Stuntz [TeamB] · Vertex Systems Corp. · Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
Please read and follow Borland's rules for the user of their
server: http://support.borland.com/entry.jspa?externalID=293
.
- References:
- WHERE 1=2 with performance nightmares
- From: Sarah
- Re: WHERE 1=2 with performance nightmares
- From: Kim Madsen
- Re: WHERE 1=2 with performance nightmares
- From: Craig Stuntz [TeamB]
- Re: WHERE 1=2 with performance nightmares
- From: Kim Madsen
- Re: WHERE 1=2 with performance nightmares
- From: Craig Stuntz [TeamB]
- Re: WHERE 1=2 with performance nightmares
- From: Del Murray
- Re: WHERE 1=2 with performance nightmares
- From: Craig Stuntz [TeamB]
- Re: WHERE 1=2 with performance nightmares
- From: Kim Madsen
- Re: WHERE 1=2 with performance nightmares
- From: Craig Stuntz [TeamB]
- Re: WHERE 1=2 with performance nightmares
- From: Del Murray
- WHERE 1=2 with performance nightmares
- Prev by Date: Re: WHERE 1=2 with performance nightmares
- Next by Date: Re: OOT: TurboPHP is now open sourced!
- Previous by thread: Re: WHERE 1=2 with performance nightmares
- Next by thread: Re: WHERE 1=2 with performance nightmares
- Index(es):
Relevant Pages
|