Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9069

Re: Navigating through a cursor

$
0
0

Hi Patrick,

 

One other possible approach given your current logic would be to index into a result set, say at position 90, by doing SELECT .. FROM .. WHERE .. OFFSET 90 (and if needed, LIMIT if you need a subset).

 

Hard to say what the performance impact would be, but generally speaking looping with single selects carries more overhead than looping through a cursor. But perhaps it's a useful approach?

 

Regarding your logic, it may be too much trouble - but if not, I'd be interested to hear what all is required.

 

If you have to look for a certain count, could you not do something like:

 

SELECT "JOIN_FIELDS", COUNT(*).. FROM.. GROUP BY.. HAVING COUNT(*) > 5 (as example)

 

and then join those results?

 

I've seen a lot of creative ways to solve complex logic with set-processing approaches. Perhaps there's more room for optimization and simplification?


Viewing all articles
Browse latest Browse all 9069

Trending Articles



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