Re: [HACKERS] DISTINCT/Optimizer question

2006-07-15 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] writes: On the other side of the coin, there's the analogy to GROUP BY that Greg points out --- there's some duplicated functionality there, but again it doesn't carry over to DISTINCT ON, AFAICS. The equivalent query for: SELECT DISTINCT ON (x,y) a,b,c FROM ...

Re: [HACKERS] DISTINCT/Optimizer question

2006-07-13 Thread Tom Lane
Hi Beth, Beth Jen [EMAIL PROTECTED] writes: Right now, the distinct clause adds its targets to the sort clause list when it is parsed. Yeah, the DISTINCT/DISTINCT ON implementation is currently rather tightly tied to sorting :-(. This is ancient code and badly in need of redesign, but it's

[HACKERS] DISTINCT/Optimizer question

2006-07-07 Thread Beth Jen
Hello, My name is Beth Jen and I'm a Summer of Code student currently adding a hash-based implementation of DISTINCT to PostgreSQL. My prototype is near completion, and the current design is as follows: I've created a new exec node that uses hash table functions in execGrouping. The node simply

Re: [HACKERS] DISTINCT/Optimizer question

2006-07-07 Thread Martijn van Oosterhout
On Fri, Jul 07, 2006 at 01:25:53PM -0400, Beth Jen wrote: Right now, the distinct clause adds its targets to the sort clause list when it is parsed. This causes an automatic insertion of the sort node into the query plan before the application of the unique node. The hash-based implementation

Re: [HACKERS] DISTINCT/Optimizer question

2006-07-07 Thread Greg Stark
Martijn van Oosterhout kleptog@svana.org writes: On Fri, Jul 07, 2006 at 01:25:53PM -0400, Beth Jen wrote: Right now, the distinct clause adds its targets to the sort clause list when it is parsed. This causes an automatic insertion of the sort node into the query plan before the