[HACKERS] Top-k optimizations?

2005-01-13 Thread David Fetter
Folks, As this came up in a work situation, I was wondering a little bit about the top-k issue. Right now, top-k is implemented (most easily, I think) via a SELECT with a LIMIT and no OFFSET. 3 questions arise from this. 1. Are there currently any optimizations specific to top-k in

Re: [HACKERS] Top-k optimizations?

2005-01-13 Thread Kris Jurka
On Thu, 13 Jan 2005, David Fetter wrote: 3. What kinds of top-k optimizations might (eventually) be included in PostgreSQL? See the TODO item: Allow ORDER BY ... LIMIT 1 to select high/low value without sort or index using a sequential scan for highest/lowest values If only one value

Re: [HACKERS] Top-k optimizations?

2005-01-13 Thread Ron Mayer
David Fetter wrote: Folks, As this came up in a work situation, I was wondering a little bit about the top-k issue. Right now, top-k is implemented (most easily, I think) via a SELECT with a LIMIT and no OFFSET. 3 questions arise from this. I think the simplest LIMIT query doesn't make it easy