pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Thomas Kellerer <shammat@gmx.net>
Cc: pgsql-performance@lists.postgresql.org <pgsql-performance@lists.postgresql.org>
Subject: Re: PostgreSQL does not choose my indexes well
Date: Thu, 23 Apr 2020 16:45:42 -0400
Message-ID: <12521.1587674742@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwbNs3Avhz0vXU3uabymEoxWsXH9bhCiMWDSkhuPt5-mHg@mail.gmail.com>
References: <35dc90d6-e0c2-13b8-3184-e3db5d854a78@gmail.com>
	<1bb37a19-77f6-8c49-073e-ed6251c98583@gmx.net>
	<CAKFQuwY9twbudMDvmuo+9Mjy0y-cJcvzPazD07-oB+WV1qOMnA@mail.gmail.com>
	<4315.1587655779@sss.pgh.pa.us>
	<20200423171858.GE13712@tamriel.snowman.net>
	<18681.1587664601@sss.pgh.pa.us>
	<20200423200143.GK13712@tamriel.snowman.net>
	<12000.1587673987@sss.pgh.pa.us>
	<CAKFQuwbNs3Avhz0vXU3uabymEoxWsXH9bhCiMWDSkhuPt5-mHg@mail.gmail.com>

"David G. Johnston" <david.g.johnston@gmail.com> writes:
> I noticed that too...I suspect its related to the ANALYZE result:

> Index Scan using idx_tabla_entidad on entidad (cost=0.56..51121.41
> rows=1405216 width=20) (actual time=0.037..242.609 rows=1409985 loops=1)
>    Index Cond: ((cod_tabla)::bigint = 4)

Yeah, that *strongly* suggests that cod_tabla isn't really bigint.
I'm wondering about domains, for instance.

			regards, tom lane





view thread (21+ messages)  latest in thread

Message-ID: <12521.1587674742@sss.pgh.pa.us>
Permalink:  ../12521.1587674742@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12521.1587674742@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, sfrost@snowman.net, shammat@gmx.net, pgsql-performance@lists.postgresql.org
  Subject: Re: PostgreSQL does not choose my indexes well
  In-Reply-To: <12521.1587674742@sss.pgh.pa.us>

* 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