pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Arcadio Ortega Reinoso <arcadio.ortega@gmail.com>
To: pgsql-performance@lists.postgresql.org
Subject: Re: PostgreSQL does not choose my indexes well
Date: Thu, 23 Apr 2020 23:01:36 +0200
Message-ID: <f79d1a82-af70-116e-717f-29f308190572@gmail.com> (raw)
In-Reply-To: <12521.1587674742@sss.pgh.pa.us>
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>
	<12521.1587674742@sss.pgh.pa.us>

El 23/4/20 a las 22:45, Tom Lane escribió:
> "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
>
>
Actually

CREATE DOMAIN cod_pk AS bigint;

create table public.tabla
(
     cod_tabla cod_pk not null,
     tabla varchar(31) not null,
     constraint pk_tabla primary key (cod_tabla)
);


Do you think is important?


Thank you very much to all








view thread (21+ messages)  latest in thread

Message-ID: <f79d1a82-af70-116e-717f-29f308190572@gmail.com>
Permalink:  ../f79d1a82-af70-116e-717f-29f308190572@gmail.com/
Also on:    postgresql.org/message-id/f79d1a82-af70-116e-717f-29f308190572@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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: arcadio.ortega@gmail.com, pgsql-performance@lists.postgresql.org
  Subject: Re: PostgreSQL does not choose my indexes well
  In-Reply-To: <f79d1a82-af70-116e-717f-29f308190572@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