Re: 7.4 Wishlist

From: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-02 20:34:20
Message-ID: 063201c29a42$316532f0$f80c0a0a@mnd
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> wrote:
>> Mysql is planning on making this work:
>>
>> SELECT id, @a:=COUNT(*), SUM(sum_col)/@a FROM table_name GROUP BY
>> id.
>>
>> Do we have anything like it (After a discussion with Tom i figure
>> no). User variables is nice, especially in these kind of queries.
>
> Well of course they have to make that work - they don't have
> subselects :P
>
> Chris

Yeah, but there is a point about running count(*) one time too many.
Say if i would like to get a prettyprinting query like this:

SELECT id, @a:=COUNT(*), sum_col::text||'/'@a::text FROM table_name;

That would be DAMN expensive doing with a subselect:

SELECT id, sum_col||'/'||(select COUNT(*) from tabe_name) FROM
table_name;

I know this example suck eggs, but you get the point where it hurts,
right?

Magnus - sorry for the dupe, chris

In response to

Responses

Browse pgsql-advocacy by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-12-02 20:48:38 Re: 7.4 Wishlist
Previous Message Christopher Kings-Lynne 2002-12-02 20:25:34 Re: 7.4 Wishlist

Browse pgsql-general by date

  From Date Subject
Next Message Terry Yapt 2002-12-02 20:35:59 Public Schema.
Previous Message Terry Yapt 2002-12-02 20:32:51 passwords in pg_shadow

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2002-12-02 20:34:42 Re: ALTER TABLE schema SCHEMA TO new_schema?
Previous Message Rod Taylor 2002-12-02 20:31:03 ALTER .. ADD PRIMARY KEY