Re: Surprised by index choice for count(*)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rob Sargent <robjsargent(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Surprised by index choice for count(*)
Date: 2018-05-01 16:11:12
Message-ID: 31534.1525191072@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Rob Sargent <robjsargent(at)gmail(dot)com> writes:
> Should I be?  I would have thought the pk would have been chosen v.
> function index?

If I'm reading this correctly, the PK index contains uuids while
the fpv index contains float4s, meaning the latter is probably half
the size. So scanning it is a lot cheaper, at least according to
the planner's cost model.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2018-05-01 16:13:20 Re: Surprised by index choice for count(*)
Previous Message David G. Johnston 2018-05-01 16:07:49 Re: Surprised by index choice for count(*)