Showing posts with label somebody. Show all posts
Showing posts with label somebody. Show all posts

Tuesday, March 20, 2012

query execution plan

Hi,
Could somebody explain me about the query execution plan in the sql
analyzer?
When i look at the execution plan i see several icons displaying 100% or
sometimes a higher percentage. Should all icons be 0% or does it depends
on the icon?Hi
If you have multiple 100%s then you probably have multiple batches. Within a
batch all the nodes should add up to 100% each percent indicates how much of
the total cost the given node costs.
You may want to read up on the topic "Graphically Displaying the Execution
Plan Using SQL Query Analyzer" in Books online.
John
"Jason" wrote:

> Hi,
> Could somebody explain me about the query execution plan in the sql
> analyzer?
> When i look at the execution plan i see several icons displaying 100% or
> sometimes a higher percentage. Should all icons be 0% or does it depends
> on the icon?
>|||John Bell wrote:
> Hi
> If you have multiple 100%s then you probably have multiple batches. Within
a
> batch all the nodes should add up to 100% each percent indicates how much
of
> the total cost the given node costs.
> You may want to read up on the topic "Graphically Displaying the Execution
> Plan Using SQL Query Analyzer" in Books online.
> John
> "Jason" wrote:
>
Hi John,
I've read BOL, but it doesn't say what's better. Should the total of the
executionplan be 0% or should some of the icons be 0%. I've some 400%
(index scan icon), but is that a good thing?|||Hi
Everything should total to around 100%, so having 400% for a single node is
confusing! Check your indexes are not fragmented and that the statistics are
up-to-date.
You should be looking at lowering the percentage as much as possible, but
having something that takes 50% of 1 minute is better than having something
that is 20% of 5 minutes!
John
"Jason" wrote:

> John Bell wrote:
> Hi John,
> I've read BOL, but it doesn't say what's better. Should the total of the
> executionplan be 0% or should some of the icons be 0%. I've some 400%
> (index scan icon), but is that a good thing?
>

Friday, March 9, 2012

Query Date Type - Somebody help me!p

Hi,

I have a table with the follow fields :

ID - Int
Date - Datetime

I need to make a simple query to result the records between to dates with a single ID.

Ex.: Get the records between 01/08/2003 to 30/08/2003 only from ID=230

Im using the follow :

ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('Select * from Apro where data between Inicio and Final');

ADOQuery1.Parameters[0].Value:=Inicio;
ADOQuery1.Parameters[2].Value:=Final;

ADOQuery1.Open;

When I open the query it doesnt work cos its result a null set
How can I solve this?

Im using SQL Server 2000 and Delphi 6

Thanks for atention.where u have

Select * from Apro where data between Inicio and Final

should data be date ?? --> Date - Datetime
or u did that on purpose

Can u output the record source that is being executed ?