Unix Technical Forum

Indicies on temp tables

This is a discussion on Indicies on temp tables within the Sybase forums, part of the Database Server Software category; --> Sometimes when I use temp tables in stored procedures I put indices on them in the hope that they ...


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, 06:00 PM
Wayne Happ
 
Posts: n/a
Default Indicies on temp tables


Sometimes when I use temp tables in stored procedures I put indices on them
in the hope that they improve performance. My boss says that the indices do
not work.

I'm pretty sure that I sometimes see improvement. Especially if I create the
tables in one proc and call another that uses them.

Comments please.

Wayne


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 06:00 PM
Michael Peppler
 
Posts: n/a
Default Re: Indicies on temp tables

On Mon, 01 Aug 2005 22:35:51 -0400, Wayne Happ wrote:

>
> Sometimes when I use temp tables in stored procedures I put indices on
> them in the hope that they improve performance. My boss says that the
> indices do not work.
>
> I'm pretty sure that I sometimes see improvement. Especially if I create
> the tables in one proc and call another that uses them.


I believe that in relatively recent versions of ASE the indexes that you
create on temp tables (even in the same batch/proc) will be used by
queries. You can always check this with a showplan output...


Michael
--
Michael Peppler [TeamSybase] mpeppler@peppler.org - http://www.peppler.org/
Sybase DBA/Developer
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-08-2008, 06:00 PM
Simon Smith
 
Posts: n/a
Default Re: Indicies on temp tables

There is of course a play off between the time taken to create your
index and the lost in scanning the temp table, depending on how large
the resultset is.

Michael Peppler wrote:
> On Mon, 01 Aug 2005 22:35:51 -0400, Wayne Happ wrote:
>
>
>>Sometimes when I use temp tables in stored procedures I put indices on
>>them in the hope that they improve performance. My boss says that the
>>indices do not work.
>>
>>I'm pretty sure that I sometimes see improvement. Especially if I create
>>the tables in one proc and call another that uses them.

>
>
> I believe that in relatively recent versions of ASE the indexes that you
> create on temp tables (even in the same batch/proc) will be used by
> queries. You can always check this with a showplan output...
>
>
> Michael

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 02:22 AM.


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