dbTalk Databases Forums  

Re: plan not using index when using >= and / or <= with non-literalvalue?

comp.databases.sybase comp.databases.sybase


Discuss Re: plan not using index when using >= and / or <= with non-literalvalue? in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Anthony Mandic
 
Posts: n/a

Default Re: plan not using index when using >= and / or <= with non-literalvalue? - 06-27-2003 , 01:06 AM






John Salvo wrote:
Quote:
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.

Quote:
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


Reply With Quote
  #2  
Old   
Kevin Sherlock
 
Posts: n/a

Default Re: plan not using index when using >= and / or <= with non-literal value - 06-27-2003 , 05:00 PM







Originally posted by John Salvo
Quote:
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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.