This is a discussion on Re: plan not using index when using >= and / or <= with non-literalvalue? within the Sybase forums, part of the Database Server Software category; --> John Salvo wrote: > > Is it a fair assumption that ASE ( using 12.5.0.3 ) will not use ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| John Salvo wrote: > > Is it a fair assumption that ASE ( using 12.5.0.3 ) will not use an > index if the WHERE clause: > > 1) Uses a range ( >, >=, <, <=, or combination thereof ) instead of > equality ( = ) .. AND > 2) The search-argument is non-literal ( value from function or even a > bind variable / placholder ) It can use an index in a range query if a suitable index exists. A less than or less than or equal query, perhaps not, unless the index is descending. A value from a function should be OK. There are some issues with literals and local variables in sprocs though. The P&T Guide should cover this. > Consider the following 2 queries below. The query is guaranteed not to > return any rows and statistics on both table and indexes were just > updated prior to this. Are you running this within an sproc? It might be an idea to post this message to the ase.performance+tuning newsgroup on Forums and get Eric Miner's attention. -am © 2003 |
| ||||
| Originally posted by John Salvo > > Alrady posted to s.p.a.p+t ng .... not to much activity their lately. > I'd beg to differ. I responded to this within 24 hours of it being posted there. Inactivity doesn't really mean you won't get a response -- Posted via http://dbforums.com |