pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jason Kim <git@jasonk.me>
To: pgsql-bugs@lists.postgresql.org
Subject: Missing SELECT output on btree_gin char, BTLess* strategy
Date: Mon, 9 Aug 2021 17:16:49 -0700
Message-ID: <20210810001649.htnltbh7c63re42p@jasonk.me> (raw)

The expected output in contrib/btree_gin/expected/char.out is wrong for the
first two SELECTs using the BTLess* strategies: they should not be empty.

    set enable_seqscan=off;

    CREATE TABLE test_char (
            i "char"
    );

    INSERT INTO test_char VALUES ('a'),('b'),('c'),('d'),('e'),('f');

    CREATE INDEX idx_char ON test_char USING gin (i);

    SELECT * FROM test_char WHERE i<'d'::"char" ORDER BY i;
    SELECT * FROM test_char WHERE i<='d'::"char" ORDER BY i;

gives

     i
    ---
    (0 rows)

     i
    ---
    (0 rows)

If Bitmap Scan is turned off, we get output, as expected:

    set enable_bitmapscan=off;
    SELECT * FROM test_char WHERE i<'d'::"char" ORDER BY i;
    SELECT * FROM test_char WHERE i<='d'::"char" ORDER BY i;

gives

     i
    ---
     a
     b
     c
    (3 rows)

     i
    ---
     a
     b
     c
     d
    (4 rows)

I tried the following and got the same results:

- Do the inserts after the CREATE INDEX.
- Create the index with fastupdate turned off: CREATE INDEX ... WITH
  (fastupdate = off).
- Reconnect (and don't forget to disable sequential scan).
- Stop and start the server: pg_ctl restart.

I'm on 15devel, but this issue appears to have been around for years.





view thread (3+ messages)  latest in thread

Message-ID: <20210810001649.htnltbh7c63re42p@jasonk.me>
Permalink:  ../20210810001649.htnltbh7c63re42p@jasonk.me/
Also on:    postgresql.org/message-id/20210810001649.htnltbh7c63re42p@jasonk.me

 · 

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-bugs@postgresql.org
  Cc: git@jasonk.me
  Subject: Re: Missing SELECT output on btree_gin char, BTLess* strategy
  In-Reply-To: <20210810001649.htnltbh7c63re42p@jasonk.me>
  References: <20210810001649.htnltbh7c63re42p@jasonk.me>

* 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