pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitry Dolgov <9erthalion6@gmail.com>
To: Dilip Kumar <dilipbalaut@gmail.com>
Cc: David Rowley <dgrowleyml@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: florisvannee@optiver.com, Peter Geoghegan <pg@bowt.ie>
Cc: Jesper Pedersen <jesper.pedersen@redhat.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: James Coleman <jtc331@gmail.com>
Cc: Rafia Sabih <rafia.pghackers@gmail.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: bhushan.uparkar@gmail.com, PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>
Subject: Re: Index Skip Scan
Date: Sun, 5 Apr 2020 18:10:29 +0200
Message-ID: <20200405161029.fpqqll7xbgfqy5na@localhost> (raw)
In-Reply-To: <CAFiTN-sgsxS7cXi0sd9UWmbSwjPc6+78rGa4SFfAxGfs5zj7Aw@mail.gmail.com>
References: <20200308142228.3zb237cd3oedspl2@localhost>
	<CAApHDvrMRHm3BoW0ZHHAmZY91HVSSkhv1zKSPfQF0QfkN7NdpQ@mail.gmail.com>
	<20200309195714.eum3b6e5mogqj3gm@localhost>
	<CAApHDvqt22FonTKv6Ek61_kjTro+9KON1G18o9jC6svec2QaDg@mail.gmail.com>
	<20200310123942.nse4uyd6yqtb7uyi@localhost>
	<CAApHDvo1NF0Qv9ZdnuDu03=1JwEq7GiVa-q3Qu=aMzmD9SV-vQ@mail.gmail.com>
	<20200324163919.7nwqe72xzfatix4y@localhost>
	<CAFiTN-ujFt8g801vYnpoveCWsm0ExjYdjkewGasOQxiH0hmjzQ@mail.gmail.com>
	<20200325085100.5fixaiteuoln4f45@localhost>
	<CAFiTN-sgsxS7cXi0sd9UWmbSwjPc6+78rGa4SFfAxGfs5zj7Aw@mail.gmail.com>

> On Sun, Apr 05, 2020 at 04:30:51PM +0530, Dilip Kumar wrote:
>
> I was just wondering how the distinct will work with the "skip scan"
> if we have some filter? I mean every time we select the unique row
> based on the prefix key and that might get rejected by an external
> filter right?

Not exactly. In the case of index-only scan, we skipping to the first
unique position, and then use already existing functionality
(_bt_readpage with stepping to the next pages) to filter out those
records that do not pass the condition. There are even couple of tests
in the patch for this. In case of index scan, when there are some
conditions, current implementation do not consider skipping.

> So I tried an example to check this.

Can you tell on which version of the patch you were testing?





view thread (248+ messages)  latest in thread

Message-ID: <20200405161029.fpqqll7xbgfqy5na@localhost>
Permalink:  ../20200405161029.fpqqll7xbgfqy5na@localhost/
Also on:    postgresql.org/message-id/20200405161029.fpqqll7xbgfqy5na@localhost

 · 

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-hackers@postgresql.org
  Cc: 9erthalion6@gmail.com, dilipbalaut@gmail.com, dgrowleyml@gmail.com, horikyota.ntt@gmail.com, tomas.vondra@2ndquadrant.com, pg@bowt.ie, jesper.pedersen@redhat.com, alvherre@2ndquadrant.com, thomas.munro@gmail.com, jtc331@gmail.com, rafia.pghackers@gmail.com, jeff.janes@gmail.com, a.korotkov@postgrespro.ru
  Subject: Re: Index Skip Scan
  In-Reply-To: <20200405161029.fpqqll7xbgfqy5na@localhost>

* 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