[SQL] ORDER BY Optimization

2005-05-06 Thread Derek Buttineau|Compu-SOLVE
Good Day, I'm hoping this is the right place to send this. I have a query that's causing me some grief trying to optimize it. The query cost is fine until I order the data set. Mind you after it's been ran and cached, subsequent calls to it are near instant. The Query in question is: select

Re: [SQL] ORDER BY Optimization

2005-05-06 Thread Derek Buttineau|Compu-SOLVE
Thanks for the response :) That's 50-ish ms versus 80-odd seconds. It seems to me a merge join might be more appropriate here than a nestloop. What's your work_mem set at? Off-the-cuff numbers show the dataset weighing in the sub-ten mbyte range. Provided it's not already at least that big, and yo