Re: sortsupport for text - Mailing list pgsql-hackers

From Greg Stark
Subject Re: sortsupport for text
Date
Msg-id CAM-w4HM3717Xwq7DzXWjvkr9N7Th6HMOY4AO7yCQBr-yP_NpfQ@mail.gmail.com
Whole thread Raw
In response to sortsupport for text  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: sortsupport for text
Re: sortsupport for text
List pgsql-hackers
On Fri, Mar 2, 2012 at 8:45 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> 12789    28.2686  libc-2.13.so             strcoll_l
> 6802     15.0350  postgres                 text_cmp

I'm still curious how it would compare to call strxfrm and sort the
resulting binary blobs. I don't think the sortsupport stuff actually
makes this any easier though. Since using it requires storing the
binary blob somewhere I think the support would have to be baked into
tuplesort (or hacked into the sortkey as an expr that was evaluated
earlier somehow).

It's a tradeoff and not an obvious one. The binary blobs are larger
and it would mean reading and copying more data around memory. But it
would mean doing the work that strcoll_l does only n times instead of
nlogn times. That might be a pretty significant gain.

--
greg


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: foreign key locks, 2nd attempt
Next
From: Alvaro Herrera
Date:
Subject: Re: foreign key locks, 2nd attempt