1

Topic: Re: Search in an index instead of . Why?

Because to read 149990 records as a rule not longer, than 150000.

2

Re: Re: Search in an index instead of . Why?

_;
In your case Index Seek = Range Scan
More in detail - http://sqlblog.com/blogs/paul_white/arc … -scan.aspx

3

Re: Re: Search in an index instead of . Why?

_;
Probably, for the first time the request was fulfilled with value of parameter @P1 = 1?
Then the server "fairly peeped" this value, saw that it is equal 1, understood, for such deal to do an index  easier, and added "the curve plan" to itself in a head a cache of plans.
In the second time the server already on "" fulfilled request with the same plan, as earlier in spite of the fact that value of parameter changed with 1 on 100.
For check of this guess try "to ask politely" the server to rebuild the plan each time (option (recompile)) and look at result at value of parameter 100.

4

Re: Re: Search in an index instead of . Why?

Anna wrote:

Andrej_Batkovich;
Probably, for the first time the request was fulfilled with value of parameter @P1 = 1?
Then the server "fairly peeped" this value, saw that it is equal 1, understood, for such deal to do an index   seek easier, certainly, and added "the curve plan" to itself in a head a cache of plans.
In the second time the server already on "" fulfilled request with the same plan, as earlier in spite of the fact that value of parameter changed with 1 on 100.
For check of this guess try "to ask politely" the server to rebuild the plan each time (option (recompile)) and look at result at value of parameter 100.

5

Re: Re: Search in an index instead of . Why?

Anna wrote:

it is passed...

At the HARDWARE the trivial plan, there even to statistican it is not necessary to look.

6

Re: Re: Search in an index instead of . Why?

msLex;
It you on the basis of what drew such outputs? The plan did not result the HARDWARE. And that he names the table - in practice can appear representation with a heap  and branchy logic obtaining of total result... Free and to genius short (if to believe a proverb that "short - the sister of talent") retelling by the author of a topic of the plan of request - also does not suggest trust.
But even if and so the server, basically, could "" and on the linear request from one table with the filtration only stipulation. Therefore, as on me so it is completely not obvious that at the author all is trivial...

7

Re: Re: Search in an index instead of . Why?

Anna wrote:

msLex;
It you on the basis of what drew such outputs? The plan did not result the HARDWARE. And that he names the table - in practice can appear representation with a heap  and branchy logic obtaining of total result... Free and to genius short (if to believe a proverb that "short - the sister of talent") retelling by the author of a topic of the plan of request - also does not suggest trust.
But even if and so the server, basically, could "" and on the linear request from one table with the filtration only stipulation. Therefore, as on me so it is completely not obvious that at the author all is trivial...

With I twist strongly I doubt (though who knows), but here sampling of 1 field of the table with the filter on this field and index presence on the same field is precisely trivial plan.
If result  reverse, I will be grateful.

8

Re: Re: Search in an index instead of . Why?

invm;
I abandon to the idea that is very similar to truth...
"" found the first entrance of required value, and further - (as a matter of fact) "" an index navigation under the two-chained list of sheet index entries (whatever one may do, but will be rendzh-skan). As except indexed value to return in result  it is necessary nothing,  on the table does not arise and "purely mechanically" the index-sik works as an index-skan. But the server killed one shot of two hares - in case the parameter @p1 = 1 arrives - for such deal the variant of the plan with  will be more than by the way, in comparing with ...

9

Re: Re: Search in an index instead of . Why?

_;
Once again re-read the link from [user=invm] and my previous post .
Like all logically it turns out...

10

Re: Re: Search in an index instead of . Why?

Anna wrote:

Andrej_Batkovich;
Once again re-read the link from [user=invm] and my previous post .
Like all logically it turns out...

it was in a post, if that... smile