pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Craig Ringer <craig@postnewspapers.com.au>
Cc: Eliot Gable <egable+pgsql-performance@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Highly Efficient Custom Sorting
Date: Fri, 02 Jul 2010 00:08:50 -0400
Message-ID: <4767.1278043730@sss.pgh.pa.us> (raw)
In-Reply-To: <4C2D574E.5030308@postnewspapers.com.au>
References: <AANLkTikrA8M3cncIHkFqsJ78TzCnQdriE0GjvK8XjB9E@mail.gmail.com>
	<4C2D574E.5030308@postnewspapers.com.au>

Craig Ringer <craig@postnewspapers.com.au> writes:
> On 02/07/10 08:46, Eliot Gable wrote:
>> So, the bottom line is, I need a faster way to do this sorting. 

> You haven't showed us how you're doing it at the moment, so it's awfully
> hard to comment usefully on possible approaches.

I'm guessing from tea leaves, but the impression I got from Eliot's
description is that he's using plpgsql functions as sort comparators.
It's not surprising that that sucks performance-wise compared to having
the equivalent logic in C/C++ functions used as comparators on the
client side.  plpgsql is no speed demon.  Best fix might be to code the
comparators as C functions on the server side.

			regards, tom lane



view thread (22+ messages)  latest in thread

Message-ID: <4767.1278043730@sss.pgh.pa.us>
Permalink:  ../4767.1278043730@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4767.1278043730@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, craig@postnewspapers.com.au, egable+pgsql-performance@gmail.com
  Subject: Re: Highly Efficient Custom Sorting
  In-Reply-To: <4767.1278043730@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox