Re: [HACKERS] putting CHECK_FOR_INTERRUPTS in

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Charles Duffy <charles(dot)duffy(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] putting CHECK_FOR_INTERRUPTS in
Date: 2006-07-29 17:15:18
Message-ID: 200607291715.k6THFIO24421@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


Are we done with the sort interrupt issue mentioned in the subject line,
and the issue outlined below?

---------------------------------------------------------------------------

Tom Lane wrote:
> "Charles Duffy" <charles(dot)duffy(at)gmail(dot)com> writes:
> > ... For the 'long' data, the compare moves on rightward until it
> > encounters 'flato', which is a TEXT column with an average length of
> > 7.5k characters (with some rows up to 400k). The first 6 columns are
> > mostly INTEGER, so compares on them are relatively inexpensive. All
> > the expensive compares on 'flato' account for the disproportionate
> > difference in sort times, relative to the number of rows in each set.
>
> Yeah, and it's not just that it's text either. At those sizes, all
> the values will be toasted, which means each compare is paying the
> price of fetching multiple rows from the toast table. And decompressing
> them too, no doubt. These costs are most likely swamping the actual
> strcoll() (not that that's not bad enough compared to int4cmp).
>
> We could probably tweak the sorting code to forcibly detoast sort keys
> before beginning the sort, but I'm not entirely convinced that would be
> a win: reading and writing enormous sort keys won't be cheap either.
>
> Meanwhile, for a cheap solution: do you really need to sort on flato
> at all? Maybe sorting on substr(flato,1,100) would be good enough?
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2006-07-29 17:30:42 Re: [PATCHES] c.h is the problem of msvc.
Previous Message Luke Lonergan 2006-07-29 16:43:21 Re: On-disk bitmap index patch

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2006-07-29 17:30:42 Re: [PATCHES] c.h is the problem of msvc.
Previous Message Bruce Momjian 2006-07-29 15:21:44 Re: [HACKERS] More #ifdef fun: src/interfaces/libpq/win32.c