Re: [PATCHES] Proof of concept for MIN/MAX optimization

2005-04-14 Thread Tom Lane
Mark Kirkwood [EMAIL PROTECTED] writes:
 The handling of nulls is a little unexpected (still todo?) :

Yeah, that was broken in the first draft :-( ... I think it's OK in
the committed version though.

regards, tom lane

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [PATCHES] Proof of concept for MIN/MAX optimization

2005-04-14 Thread Mark Kirkwood
Tom Lane wrote:
Mark Kirkwood [EMAIL PROTECTED] writes:
The handling of nulls is a little unexpected (still todo?) :

Yeah, that was broken in the first draft :-( ... I think it's OK in
the committed version though.
(post cvs update) yeah - looks good!
regards
Mark
---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [PATCHES] Proof of concept for MIN/MAX optimization

2005-04-13 Thread Mark Kirkwood
Tom Lane wrote:
I haven't done the work yet to add a column to pg_aggregate, so this
just knows about optimizing a couple of hard-wired cases (int4 and
text).  Other than that it's reasonably complete, I think.  Comments?
Looks good :
regression=# explain select max(unique1) from tenk1;
   QUERY PLAN
-
 Result  (cost=0.15..0.16 rows=1 width=0)
   InitPlan
 -  Limit  (cost=0.00..0.15 rows=1 width=4)
   -  Index Scan Backward using tenk1_unique1 on tenk1 
(cost=0.00..1512.59 rows=1 width=4)
(4 rows)

The handling of nulls is a little unexpected (still todo?) :
regression=# insert into tenk2 (unique1,unique2) values(null, 1);
INSERT 0 1
regression=# select max(unique1) from tenk2;
 max
-
(1 row)
regression=# set enable_indexscan=0;
SET
regression=# select max(unique1) from tenk2;
 max
--
 
(1 row)
cheers
Mark

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


[PATCHES] Proof of concept for MIN/MAX optimization

2005-04-10 Thread Tom Lane
I haven't done the work yet to add a column to pg_aggregate, so this
just knows about optimizing a couple of hard-wired cases (int4 and
text).  Other than that it's reasonably complete, I think.  Comments?

regards, tom lane



binNkvLb5n8b6.bin
Description: minmax-0.patch.gz

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly