Subject | optimization question (select) |
---|---|
Author | svanderclock |
Post date | 2009-12-05T19:19:17Z |
hello,
it's my optimization day today. thanks to dinitry i understand how to otpimize my order by.
now how to optimize this simple SQL :
select * from BIGTABLE
where
fieldA > xxx and
fieldA < yyy and
fieldB > www and
fieldB < ppp
fieldA and fieldB are numeric(15,5)
create a index on (fieldA, fieldB) seam to no help too much (it's speed only the work on FieldA, but not on fieldB)
in the worse case (xxx and yyy too large and www and ppp too restrictive) this simple query with an plan using an index on (fieldA, fieldB) can take more than 10 seconds to return :(
"denormalize" the data is not a problem if it's can solve the probleme ...
thanks for all
stephane
it's my optimization day today. thanks to dinitry i understand how to otpimize my order by.
now how to optimize this simple SQL :
select * from BIGTABLE
where
fieldA > xxx and
fieldA < yyy and
fieldB > www and
fieldB < ppp
fieldA and fieldB are numeric(15,5)
create a index on (fieldA, fieldB) seam to no help too much (it's speed only the work on FieldA, but not on fieldB)
in the worse case (xxx and yyy too large and www and ppp too restrictive) this simple query with an plan using an index on (fieldA, fieldB) can take more than 10 seconds to return :(
"denormalize" the data is not a problem if it's can solve the probleme ...
thanks for all
stephane