Re: GIN: any ordering guarantees for the hits returned?

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Alex Drobychev <adrobj(at)yahoo(dot)com>
Cc: David Fetter <david(at)fetter(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: GIN: any ordering guarantees for the hits returned?
Date: 2007-11-20 11:20:46
Message-ID: 20071120112046.GB5167@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alex Drobychev wrote:

> I agree with this maybe 98% - but not 100%. :-) Unfortunately
> performance can change rather unpredictably when the DB stops
> fitting in memory - say, 3-4 months after a production roll-out, too
> late for profiling experiments. :-(

Surely you're capable of inventing random data to simulate the load
you'll have in 3-4 months or even a year?

David is correct in that the order is not guaranteed. It's not just a
matter of which order the rows were inserted -- the executor can do a
lot of things internally that would make the result appear in a
different order. Even when the data is CLUSTER'ed the ordering can be
lost. If you want to have a guaranteed order, use ORDER BY.

--
Alvaro Herrera Developer, http://www.PostgreSQL.org/
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end." (2nd Commandment for C programmers)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Josh Harrison 2007-11-20 12:22:13 Re: postgresql storage and performance questions
Previous Message Oleg Bartunov 2007-11-20 08:50:03 Re: PostgreSQL Conference 08 East!