Re: index problems (again) - Mailing list pgsql-general

From Geoff Winkless
Subject Re: index problems (again)
Date
Msg-id CAEzk6fd6=nEzabNOL+ANH=pp+=9TERZ_yUi7ijb8N_4-esTrOA@mail.gmail.com
Whole thread Raw
In response to Re: index problems (again)  (Geoff Winkless <pgsqladmin@geoff.dj>)
List pgsql-general
On 7 March 2016 at 14:27, I wrote:
> So it seems that it should in fact be usable after all. So I'm still
> stumped as to why the (scdate,sc_id) index isn't used :(

Also, while the index on sc_id will be sorted there's no guarantee
that sc_id values will be in order in the table itself, so you're
still left with (30,000) potentially random accesses to the table,
even assuming fully random distribution of scdate (with a worst-case
of 970000 random accesses). That average case is no better than the
(30,000) random accesses that were required from using an scdate
index, even ignoring the scdate/sc_id index.

So I'm afraid I'm fully back in the "I still don't get it" column.

Geoff


pgsql-general by date:

Previous
From: Geoff Winkless
Date:
Subject: Re: index problems (again)
Next
From: Tom Lane
Date:
Subject: Re: index problems (again)