Re: killing processes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: killing processes
Дата
Msg-id 15449.1248196398@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: killing processes  (David Kerr <dmk@mr-paradox.net>)
Ответы Re: killing processes
Список 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 по дате отправления:

Предыдущее
От: "Chris Spotts"
Дата:
Сообщение: Re: array_agg crash?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: array_agg crash?