Re: killing processes - Mailing list pgsql-general

From Tom Lane
Subject Re: killing processes
Date
Msg-id 15449.1248196398@sss.pgh.pa.us
Whole thread Raw
In response to Re: killing processes  (David Kerr <dmk@mr-paradox.net>)
Responses Re: killing processes
List pgsql-general
David Kerr <dmk@mr-paradox.net> 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

pgsql-general by date:

Previous
From: "Chris Spotts"
Date:
Subject: Re: array_agg crash?
Next
From: Tom Lane
Date:
Subject: Re: array_agg crash?