pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Marco Colli <collimarco91@gmail.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: Bad query plan when you add many OR conditions
Date: Fri, 10 Jan 2020 10:18:02 -0500
Message-ID: <28696.1578669482@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFvCgN7yQFLjwLSs7VPLp8VxUrGTy5uzmQ8_GfraXTUSQdyoQQ@mail.gmail.com>
References: <CAFvCgN5N+C1BZdri5t2gnP15UFNBGtg6Ve0nJ7WALr4XwWYorg@mail.gmail.com>
	<20200110030601.GH12066@telsasoft.com>
	<CAFvCgN7Kf35VDEu_e8f-qfUjq-2vhs21rbc1UJqEfos0=TMcUw@mail.gmail.com>
	<20200110133447.GI12066@telsasoft.com>
	<CAFvCgN7yQFLjwLSs7VPLp8VxUrGTy5uzmQ8_GfraXTUSQdyoQQ@mail.gmail.com>

Marco Colli <collimarco91@gmail.com> writes:
> As you can see it is a *index scan* and not an *index only* scan... I don't
> understand why. The index includes all the fields used by the query... so
> an index only scan should be possible.

Huh?  The query is "select * from ...", so it retrieves *all* columns
of the table.

			regards, tom lane





view thread (11+ messages)  latest in thread

Message-ID: <28696.1578669482@sss.pgh.pa.us>
Permalink:  ../28696.1578669482@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28696.1578669482@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, collimarco91@gmail.com, pryzby@telsasoft.com, pgsql-performance@lists.postgresql.org
  Subject: Re: Bad query plan when you add many OR conditions
  In-Reply-To: <28696.1578669482@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