Re: problem with huge joins - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: problem with huge joins
Date
Msg-id 20031101004321.GD5475@svana.org
Whole thread Raw
In response to Re: problem with huge joins  (Kolus Maximiliano <Kolus.maximiliano@bcr.com.ar>)
List pgsql-general
On Fri, Oct 31, 2003 at 01:17:45PM -0300, Kolus Maximiliano wrote:
> > > Total runtime: 317046.69 msec
>
> Total runtime: 216001.94 msec
>
>     A lot better! Thanks!
>
> > The hash indexes are a waste of time for this :-(
>
>     Which kind should I use?

My guess that for large joins it can be more useful to use indexes to
presort a table and use highly efficient merge joins instead. However, hash
indexes cannot be used to sort a table, only for lookups.

btrees are more highly optimised and can produce sorted output.

Give it a shot.

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> "All that is needed for the forces of evil to triumph is for enough good
> men to do nothing." - Edmond Burke
> "The penalty good people pay for not being interested in politics is to be
> governed by people worse than themselves." - Plato

Attachment

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: slow query performance
Next
From: Bruce Momjian
Date:
Subject: Re: 7.3.5 release (was: Re: SELECT with row>32k hangs over