pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Surprised by index choice for count(*)
Date: Tue, 1 May 2018 10:13:20 -0600
Message-ID: <59632FB7-2378-4A77-8B37-BCF5A438411F@gmail.com> (raw)
In-Reply-To: <31534.1525191072@sss.pgh.pa.us>
References: <38fc1d14-1207-cbca-18e0-b2e6f269565b@gmail.com>
	<31534.1525191072@sss.pgh.pa.us>

Thank you both.  Simple, as expected.  And I’m easily surprised.  
Version 10 (perhaps obviously) for those scoring at home.

> On May 1, 2018, at 10:11 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 
> Rob Sargent <robjsargent@gmail.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





view thread (4+ messages)

Message-ID: <59632FB7-2378-4A77-8B37-BCF5A438411F@gmail.com>
Permalink:  ../59632FB7-2378-4A77-8B37-BCF5A438411F@gmail.com/
Also on:    postgresql.org/message-id/59632FB7-2378-4A77-8B37-BCF5A438411F@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: robjsargent@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: Surprised by index choice for count(*)
  In-Reply-To: <59632FB7-2378-4A77-8B37-BCF5A438411F@gmail.com>
  References: <38fc1d14-1207-cbca-18e0-b2e6f269565b@gmail.com> <31534.1525191072@sss.pgh.pa.us> <59632FB7-2378-4A77-8B37-BCF5A438411F@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox