Quantcast
Channel: SCN: Message List - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 3587

Re: strange cache problem

$
0
0

You are correct Jean-Pierre - although I had to try it to be certain myself....."select....with recompile" only works within stored procs - outside stored procs, you get a syntax error on the "with".  However, even if it did work, it would require 15.7sp130+.

 

However, on the #temp table and indexing, one could argue leaving it in place (index on #T1.C1)  - but that would suppose that either:

 

1) The #temp table had many more rows than would be in the result set

2) The #temp tables rows would be limited by the rows in E

 

In reality, we often know that the most common (but not always) fact about #temp tables is that these are the "driving" tables for the query - e.g. all of the rows will appear in the result set - and often a 1:1 with the result set size (as was the case here).   Consequently, unless there is some really bad indexing somewhere - starting from the #temp table (as the outermost table) is often the best choice (assuming there is just one) as it has the selection criteria (if you will) for the normal tables in the query.

 

As a result, I am often not in favor of creating indexes on #temp tables unless it will be joined to itself, another #temp table or similar....


Viewing all articles
Browse latest Browse all 3587

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>