Showing posts with label explain. Show all posts
Showing posts with label explain. Show all posts

Monday, March 26, 2012

Query from within Excel

I have a need for some query help and I will try to explain my situation.
Thanks in advance for any help.
I have an Excel spreadsheet that has two different sheets. One one sheet
called "Data" I have created a query that pulls AP Invoices from from a SQL
database. In the results of this query I may have several lines with the
same Company.
Ok here's my question. On my other sheet page of the same file, is there
any way to run a Select statement and use the "Data" sheet as the FROM
Source?
I know this is very confusing, I just hope someone can decipher what I have
written.you can do it directly via vba. No need to access via oledb.
"Preacher Man" <nospam> wrote in message
news:O6zqUCfJGHA.1424@.TK2MSFTNGP12.phx.gbl...
>I have a need for some query help and I will try to explain my situation.
>Thanks in advance for any help.
> I have an Excel spreadsheet that has two different sheets. One one sheet
> called "Data" I have created a query that pulls AP Invoices from from a
> SQL database. In the results of this query I may have several lines with
> the same Company.
> Ok here's my question. On my other sheet page of the same file, is there
> any way to run a Select statement and use the "Data" sheet as the FROM
> Source?
> I know this is very confusing, I just hope someone can decipher what I
> have written.
>

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?
>

Monday, February 20, 2012

Query Analyzer: Execution Plan: Clustered Index Seek: I/O Cost

Can anyone explain how I/O cost is calculated?
My example:
Physical operation: Clustered Index Seek
Logical operation: Clustered Index Seek
Row count: 1
Estimated row size: 76
I/O cost: 0.00632
CPU cost: 0.000080
Number of executes: 1
Cost: 0.006408(100%)
Subtree cost: 0.00640
Estimated row count: 1
Argument: ...
If you really want to know some of the details about query costs, you should
read some of Joe Chang's articles at www.sql-server-performance.com . This
is an excellent site for performance tips, and Joe has several detailed
articles about calculating the cost of a query.
"Dave Owen" <DaveOwen@.discussions.microsoft.com> wrote in message
news:811149F2-25E0-43BA-B3A6-43B17D7014F4@.microsoft.com...
> Can anyone explain how I/O cost is calculated?
> My example:
> Physical operation: Clustered Index Seek
> Logical operation: Clustered Index Seek
> Row count: 1
> Estimated row size: 76
> I/O cost: 0.00632
> CPU cost: 0.000080
> Number of executes: 1
> Cost: 0.006408(100%)
> Subtree cost: 0.00640
> Estimated row count: 1
> Argument: ...