Re: index problems (again)

From: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
To: Victor Yegorov <vyegorov(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: index problems (again)
Date: 2016-03-07 14:47:13
Message-ID: CAEzk6fd6=nEzabNOL+ANH=pp+=9TERZ_yUi7ijb8N_4-esTrOA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2016-03-07 14:51:45 Re: index problems (again)
Previous Message Geoff Winkless 2016-03-07 14:27:17 Re: index problems (again)