Re: Search from newer tuples first, vs older tuples first?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>
Cc: "Hackers List" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Search from newer tuples first, vs older tuples first?
Date: 2002-05-02 04:49:41
Message-ID: 4798.1020314981@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my> writes:
> But does Postgresql visit the older tuples first moving to the newer ones,
> or the newer ones first?

It's going to visit them *all*. Reordering won't improve the
performance.

FWIW I think that with the present implementation of btree, the newer
tuples actually will be visited first --- when inserting a duplicate
key, the new entry will be inserted to the left of the equal key(s)
already present. But it doesn't matter. The only way to speed this
up is to eliminate some of the visitings, which requires keeping more
info in the index than we presently do.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lincoln Yeoh 2002-05-02 04:54:46 Search from newer tuples first, vs older tuples first?
Previous Message Tom Lane 2002-05-02 04:45:19 Re: Mac OS X: system shutdown prevents checkpoint