David Kerr <dmk@xxxxxxxxxxxxxx> writes: > On Mon, Jul 20, 2009 at 11:14:22PM -0400, Tom Lane wrote: > - Huh. How big an array were you trying to invoke it on? > there are 899991 records in the table it's just > test=# \d test2 > Table "public.test2" > Column | Type | Modifiers > --------+--------------+----------- > t1 | numeric(9,4) | I tried it on a table with 899991 random values. It took frickin' forever, but seemed to be willing to respond to cancels anywhere along the line. I'm not sure why you're seeing differently. (The reason it takes forever is that numeric is a variable-width type, and access into a varwidth array is O(n), so the sorting step you've got here is O(n^2). It might help to use unnest() instead of this handmade version of it ...) regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general