Re: killing processes

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: David Kerr <dmk(at)mr-paradox(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: killing processes
Date: 2009-07-21 18:18:24
Message-ID: b42b73150907211118y4e973383s35aa142f2b604f87@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jul 21, 2009 at 1:47 PM, David Kerr<dmk(at)mr-paradox(dot)net> wrote:
> On Tue, Jul 21, 2009 at 01:13:18PM -0400, Tom Lane wrote:
> - David Kerr <dmk(at)mr-paradox(dot)net> writes:
> - 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.
>
> Hehe, yeah. For me I let it run 10 min and hit ^C so maybe i just
> hit it at a bad place.
>
> - (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 ...)
>
> unnest() is 8.4 only, right?

There is an undocumented version in earlier versions that's quite similar:
information_schema._pg_expandarray (it's an sql function, not C, so
you should be able examine the source in order to roll your own if you
need to).

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2009-07-21 18:27:19 Re: commercial adaptation of postgres
Previous Message Chris Spotts 2009-07-21 18:01:43 Re: killing processes