Re: Fix for select sum(2+2)...

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: vadim(at)sable(dot)krasnoyarsk(dot)su (Vadim B(dot) Mikheev)
Cc: hackers(at)postgreSQL(dot)org (PostgreSQL-development)
Subject: Re: Fix for select sum(2+2)...
Date: 1998-01-14 19:58:17
Message-ID: 199801141958.OAA04562@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> Hi, Bruce!
>
> vac=> \d t
>
> Table = t
> +----------------------------------+----------------------------------+-------+
> | Field | Type | Length|
> +----------------------------------+----------------------------------+-------+
> | v | varchar() | 80 |
> | i | int4 | 4 |
> +----------------------------------+----------------------------------+-------+
> vac=> explain select sum(2+i) from t where 1 > 0;
> ERROR: replace_result_clause: Can not handle this tlist!
>
> "where 1 > 0" is also handled by Result node -> something still unfixed here
> (in optimizer). Will you fix this ?
>
> Vadim
>

I have decided the whole qry_aggs is bad. It is bad becuase it makes
multiple copies of Aggreg, and both copies must be processed by any
changes by rewrite and optimizer. I am removing the field
Query->qry_aggs, and replacing it with a function that will called when
creating the Agg which spins through the Plan target list and returns a
linked list of Agg*. Much cleaner, and I can remove much of the special
qry_aggs handling I added to get other Agg stuff to work.

Also, this relates to the SubLink change. I am now going to recommend
not having a separate Sublink pointer list field in Query, but adding a
function that will return a list of valid Sublink entries in from
qry->qual, or maybe even qry->targetlist.

--
Bruce Momjian
maillist(at)candle(dot)pha(dot)pa(dot)us

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-01-14 19:59:51 qry_aggs removal
Previous Message Peter T Mount 1998-01-14 19:36:59 Re: [HACKERS] Max size of data types and tuples. (fwd)