Re: problem with huge joins

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Kolus Maximiliano <Kolus(dot)maximiliano(at)bcr(dot)com(dot)ar>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: problem with huge joins
Date: 2003-11-01 00:43:21
Message-ID: 20031101004321.GD5475@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ryan Mack 2003-11-01 01:36:21 PostgreSQL License Question
Previous Message Martijn van Oosterhout 2003-11-01 00:31:01 Re: slow query performance