Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Sybase > indexes on temp tables inside procs - are they used?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-07-07, 07:22
mike_bike_kite mike_bike_kite is offline
Registered User
 
Join Date: Jun 2007
Location: London
Posts: 955
indexes on temp tables inside procs - are they used?

I always remember sybase would never use an index created on a temp table within a stored procedure. This seems to have changed recently but the online sybase docs still state that these indexes won' be used. I'm a bit confused. Has it changed recently? are the online sybase docs wrong? or are there certain conditions to be met before these indexes are used?

Mike
Reply With Quote
  #2 (permalink)  
Old 12-11-07, 12:36
trvishi trvishi is offline
Registered User
 
Join Date: Sep 2003
Location: Switzerland
Posts: 371
I dont think it does. You can check it with the showplan. Also, try using two procs. creation in one and usage in another.
Reply With Quote
  #3 (permalink)  
Old 12-11-07, 12:37
trvishi trvishi is offline
Registered User
 
Join Date: Sep 2003
Location: Switzerland
Posts: 371
Also, you can use dbcc traceon(302), 307 and 310 to get indepth optimiser decisions.
Reply With Quote
  #4 (permalink)  
Old 12-11-07, 13:01
mike_bike_kite mike_bike_kite is offline
Registered User
 
Join Date: Jun 2007
Location: London
Posts: 955
The index is definitely being used - it says it is in the showplan and the performance indicates it's being used. My issue is simply that the docs clearly state that these indexes are not used and this was certainly the case before. I just wondered what had happened and why sybase weren't advertising the fact that these indexes are now used. Just seems odd.

Mike
Reply With Quote
  #5 (permalink)  
Old 12-11-07, 13:21
trvishi trvishi is offline
Registered User
 
Join Date: Sep 2003
Location: Switzerland
Posts: 371
Check out the following solved case. Hope you have a support id.

http://search.sybase.com/kbx/solvedc...umber=11092625

Since I cant paste the content as it may be against copyright laws, basically it says indexes can be picked but its not guaranteed and its better to separate creation / usage and hence the docs wont be updated.

Now, it will be interesting to know in what cases that is infact true.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On