🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #550

Re: retrieve query plan

#550
From: RB Smissaert
Date: Wed, 19 Sep 2007 20:31
54 lines
3181 bytes
So when using ISQL I would need to run the query to see the plan?
I would like to get the plan without actually running the query.
So, maybe then I would need to look into using the gds32.dll api in VB.
Thanks for the hint about isc_dsql_sql_info() and isc_info_sql_get_plan
I did some Googling in this direction but nil found sofar, so it looks then
I will have to study the Interbase API documentation.

RBS


"Quinn Wildman (CodeGear Developer Support)" <qwildman@nospam.codegear.com> 
wrote in message news:46f18372$1@newsgroups.borland.com...
> Here is how to do it with isql:
>
> 1. Connect to database with isql
> 2. set plan on;
> 3. execute your query
>
> If your query returns many records, it's advisable to replace a field list 
> with count(*) so you won't be distracted with output. Either way, the plan 
> is the same.
>
> Note that this technique applies to all subsequent version of InterBase as 
> well.
>
> Using the API, call isc_dsql_sql_info() with the item 
> isc_info_sql_get_plan to get a plan.
>
> RB Smissaert wrote:
>> How could I get access the API from VB?
>> How would I do it with ISQL from the commandline?
>> I might be able to use the last and direct the output to text and get the 
>> plan from the text file.
>> Using the API directly would be the best way.
>> Thanks.
>>
>> RBS
>>
>> "Craig Stuntz [TeamB]" <craig_stuntz@nospam.please [a.k.a. acm.org]> 
>> wrote in message news:46f17982$1@newsgroups.borland.com...
>>> RB Smissaert wrote:
>>>
>>>> Is there a way in plain SQL to retrieve the Interbase query plan
>>>> given a particular query?
>>>
>>> No. You need to use the API for this, either directly or with a
>>> component set like IBX. You can also do it in command-line ISQL.
>>>
>>> -- 
>>> Craig Stuntz [TeamB] � Vertex Systems Corp. � Columbus, OH
>>>  Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
>>> All the great TeamB service you've come to expect plus (New!)
>>>  Irish Tin Whistle tips: http://learningtowhistle.blogspot.com
>> 
Technical Details
Message-ID: <46f1879f$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <46f174bb$1@newsgroups.borland.com> <46f17982$1@newsgroups.borland.com> <46f17d33$1@newsgroups.borland.com> <46f18372$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,c546675c5ab4ad6e
X-Google-Attributes: gid114a0e,public,usenet
X-Google-Language: ENGLISH,ASCII
From: "RB Smissaert" <bartsmissaert@blueyonder.co.uk>
Newsgroups: borland.public.interbase.sql
References: <46f174bb$1@newsgroups.borland.com> <46f17982$1@newsgroups.borland.com> <46f17d33$1@newsgroups.borland.com> <46f18372$1@newsgroups.borland.com>
Subject: Re: retrieve query plan
Date: Wed, 19 Sep 2007 21:31:55 +0100
Lines: 55
MIME-Version: 1.0
Content-Type: text/plain;
 format=flowed;
 charset="iso-8859-1";
 reply-type=response
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
NNTP-Posting-Host: 82.37.28.137
Message-ID: <46f1879f$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1190234015 82.37.28.137 (19 Sep 2007 13:33:35 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail