Re: Sorting Improvements for 8.4

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: Mark Mielke <mark(at)mark(dot)mielke(dot)cc>, Michał Zaborowski <michal(dot)zaborowski(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Sorting Improvements for 8.4
Date: 2007-12-20 23:33:13
Message-ID: 1198193593.10057.72.camel@dogma.ljc.laika.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2007-12-20 at 01:26 +0000, Gregory Stark wrote:
> I suspect most of that is spent just copying the data around. Which would not
> be helped by having multiple threads doing the copying -- and in fact might be
> exacerbated if it required an extra copy to consolidate all the data in the
> end.

The theory is that it could be helped by multiple threads, because of
the memory latency.

> How long does a "explain analyze sinmple select * from sorter" take?

2 seconds, but the table is already in cache I'm sure (since it's so
small).

> Note that speeding up a query from 20s to 5s isn't terribly useful. If it's
> OLTP you can't be using all your cores for each user anyways. And if it's DSS
> 20s isn't a problem.

I'm not pushing for parallel sort, I'm just brainstorming. I think Ron's
idea has merit, but I realize it also has limitations.

> Where parallel processing like this becomes attractive is when you're running
> a 2 hour query on a machine sequentially running scheduled batch jobs which
> can be sped up to 30 minutes. But in that case you're almost certainly being
> limited by your disk bandwidth, not your cpu speed.

Are you sure that's always the case? My test seemed to indicate that
sorting took longer than it would to read the file from disk.

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Mielke 2007-12-20 23:38:56 Re: Sorting Improvements for 8.4
Previous Message Mark Mielke 2007-12-20 23:20:48 Re: Sorting Improvements for 8.4