Unix Technical Forum

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

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 ...


Go Back   Unix Technical Forum > Database Server Software > Sybase

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 03:39 PM
Anthony Mandic
 
Posts: n/a
Default Re: plan not using index when using >= and / or <= with non-literalvalue?

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 03:39 PM
Kevin Sherlock
 
Posts: n/a
Default Re: plan not using index when using >= and / or <= with non-literal value


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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:57 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com