From: PFC <lists@boutiquenumerique.com>
To: Felix E. Klee <felix.klee@inka.de>
To: pgsql-sql@postgresql.org
Subject: Re: Turning column into *sorted* array?
Date: Wed, 18 May 2005 19:54:08 +0200
Message-ID: <op.sqzf0iuuth1vuj@localhost> (raw)
In-Reply-To: <87zmus8qdm.wl%felix.klee@inka.de>
References: <87zmus8qdm.wl%felix.klee@inka.de>
> SELECT array_accum(x) FROM (SELECT * FROM some_view ORDER BY x) AS tmp;
If you're using integers, you could use the int_array_accum or something
from the intarray module which is a lot faster.
I believe intarray also has a function for sorting integer arrays...
>
> BTW, the best alternative (in terms of execution performance) that comes
> into my mind is to create an aggregate that does the sorting right away
> while the values "come in" from the rows. But that'd probably take me
> some time to get right.
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: lists@boutiquenumerique.com, felix.klee@inka.de
Subject: Re: Turning column into *sorted* array?
In-Reply-To: <op.sqzf0iuuth1vuj@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox