Re: many "or" operation make system choose incorrect index
- From: lsllcm <lsllcm@xxxxxxxxx>
- Date: Wed, 28 Nov 2007 07:39:01 -0800 (PST)
On Nov 28, 6:27 am, Erland Sommarskog <esq...@xxxxxxxxxxxxx> wrote:
lsllcm (lsl...@xxxxxxxxx) writes:
Hi Gert-Jan/Erland Sommarskog,
Thanks for your input.
The whole sql is very long.
...
yes, I have reduced the OR number to 62, the optimizer chooses
different index plan. When there are 63 OR operators, the optimizer
chooses the partial index scan
Seek predicts : Prefix: [sacco].[dbo].[BCHCKBOX].SERV_PROV_CODE =
'SACCO'
Seeing you SQL, performance appears to be your smallest problem. That
code must be about unmaintainable. I would get those values in to a
table. That may or may not help you to the best performance, but at
least you will be better equipped to battle the problems.
Where can I found the document of 63 is the value?
I doubt that it's documented. I found it on my own by testing.
Because multiple client access the site, I don't know how to use
temporary table to do it, could you give me one example?
I don't see why the multiple clients would cause the problem. But since
I don't where you get all these values from or much at all about
your system, I cannot any examples.
Did you say which version of SQL Server you are using`?
--
Erland Sommarskog, SQL Server MVP, esq...@xxxxxxxxxxxxx
Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Hi Erland Sommarskog,
Could you provide the test step of 63 value
Thanks
.
- Follow-Ups:
- Re: many "or" operation make system choose incorrect index
- From: Erland Sommarskog
- Re: many "or" operation make system choose incorrect index
- References:
- many "or" operation make system choose incorrect index
- From: lsllcm
- Re: many "or" operation make system choose incorrect index
- From: Gert-Jan Strik
- Re: many "or" operation make system choose incorrect index
- From: Erland Sommarskog
- Re: many "or" operation make system choose incorrect index
- From: lsllcm
- Re: many "or" operation make system choose incorrect index
- From: Erland Sommarskog
- many "or" operation make system choose incorrect index
- Prev by Date: Re: Data insertion too too slow...
- Next by Date: Re: SQL Express - Identity specification property - how to change
- Previous by thread: Re: many "or" operation make system choose incorrect index
- Next by thread: Re: many "or" operation make system choose incorrect index
- Index(es):
Relevant Pages
|