Re: GIN: any ordering guarantees for the hits returned? - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: GIN: any ordering guarantees for the hits returned?
Date
Msg-id 20071120112046.GB5167@alvh.no-ip.org
Whole thread Raw
In response to Re: GIN: any ordering guarantees for the hits returned?  (Alex Drobychev <adrobj@yahoo.com>)
List 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)

pgsql-general by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: [pgsql-advocacy] PostgreSQL Conference 08 East!
Next
From: "Josh Harrison"
Date:
Subject: Re: postgresql storage and performance questions