pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Matthias van de Meent <boekewurm+postgres@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: Jeff Davis <pgsql@j-davis.com>
Cc: benoit <benoit@hopsandfork.com>
Cc: Alexander Korotkov <aekorotkov@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Subject: Re: Optimizing nbtree ScalarArrayOp execution, allowing multi-column ordered scans, skip scan
Date: Mon, 22 Apr 2024 11:00:00 +0300
Message-ID: <ef0f7c8b-a6fa-362e-6fd6-054950f947ca@gmail.com> (raw)
In-Reply-To: <CAH2-Wz=sUDC5Y6uzKq8VOnhGgevaFF_j8-T+z240k72d8emXXg@mail.gmail.com>
References: <CAH2-Wz=ksvN_sjcnD1+Bt-WtifRA5ok48aDYnq3pkKhxgMQpcw@mail.gmail.com>
	<CAH2-Wzm=kTenodJ2Xc3+p4Kp+0AC5MGR7kQGe0fGOXJOJO0bCQ@mail.gmail.com>
	<CAEze2Whe5L-z65DgvUgPkkLt6d2PxG1gV8Z_fNWjS9+-1jkDWw@mail.gmail.com>
	<CAH2-Wz=75d0Yx-s15QNPN2sogfZK4PF7xOQFjPS8=Ca7C0f9+g@mail.gmail.com>
	<CAEze2WhHixewkTRLhGMoMPOGmXNJBLnVNt7FuxgFpmzdricR0A@mail.gmail.com>
	<CAEze2WiPNet+Ff7wbyFUpLUPzCgUvdsoNSdo_KLcriSaDGWpow@mail.gmail.com>
	<CAH2-WzkUaZesPygO4DCv4F7QG3BpMMfDmB42S+C_KPn-jaa+yA@mail.gmail.com>
	<CAEze2WiYOpAytLraPs72FV1MvOP1Q6vZx04zHj++-ZWyNBkqUg@mail.gmail.com>
	<CAH2-WznZ5ebfv96DqpKArBBcdnCUxkMOhFGipRA5mdhPKjVHsg@mail.gmail.com>
	<CAH2-WzmQUhfpSZrvcDmyk1OtydYv=TWRYJdp75m6=9hUaeHbFA@mail.gmail.com>
	<CAH2-WzkPOyZaMVtPUT19CfGwRndDekEBmGw_rd+UqKyK9n2LdQ@mail.gmail.com>
	<CAH2-Wz=vA9F1yS2gsc==EbV7rgJ21YyV0MEtV-Q_ELN9QPOD6g@mail.gmail.com>
	<0539d3d3-a402-0a49-ed5e-26429dffc4bd@gmail.com>
	<CAH2-Wz=sUDC5Y6uzKq8VOnhGgevaFF_j8-T+z240k72d8emXXg@mail.gmail.com>

Hello Peter,

07.04.2024 20:18, Peter Geoghegan wrote:
> On Sun, Apr 7, 2024 at 1:00 PM Alexander Lakhin <exclusion@gmail.com> wrote:
>> SELECT * FROM t WHERE a < ANY (ARRAY[1]) AND b < ANY (ARRAY[1]);
>>
>> TRAP: failed Assert("so->numArrayKeys"), File: "nbtutils.c", Line: 560, PID: 3251267
> I immediately see what's up here. WIll fix this in the next short
> while. There is no bug here in builds without assertions, but it's
> probably best to keep the assertion, and to just make sure not to call
> _bt_preprocess_array_keys_final() unless it has real work to do.

Please look at another case, where a similar Assert (but this time in
_bt_preprocess_keys()) is triggered:
CREATE TABLE t (a text, b text);
INSERT INTO t (a, b) SELECT 'a', repeat('b', 100) FROM generate_series(1, 500) g;
CREATE INDEX t_idx ON t USING btree(a);
BEGIN;
DECLARE c CURSOR FOR SELECT a FROM t WHERE a = 'a';
FETCH FROM c;
FETCH RELATIVE 0 FROM c;

TRAP: failed Assert("so->numArrayKeys"), File: "nbtutils.c", Line: 2582, PID: 1130962

Best regards,
Alexander





view thread (78+ messages)  latest in thread

Message-ID: <ef0f7c8b-a6fa-362e-6fd6-054950f947ca@gmail.com>
Permalink:  ../ef0f7c8b-a6fa-362e-6fd6-054950f947ca@gmail.com/
Also on:    postgresql.org/message-id/ef0f7c8b-a6fa-362e-6fd6-054950f947ca@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 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-hackers@postgresql.org
  Cc: exclusion@gmail.com, pg@bowt.ie, boekewurm+postgres@gmail.com, tgl@sss.pgh.pa.us, tomas.vondra@enterprisedb.com, pgsql@j-davis.com, benoit@hopsandfork.com, aekorotkov@gmail.com, hlinnaka@iki.fi
  Subject: Re: Optimizing nbtree ScalarArrayOp execution, allowing multi-column ordered scans, skip scan
  In-Reply-To: <ef0f7c8b-a6fa-362e-6fd6-054950f947ca@gmail.com>
  References: <CAH2-Wz=ksvN_sjcnD1+Bt-WtifRA5ok48aDYnq3pkKhxgMQpcw@mail.gmail.com> <CAEze2Whe5L-z65DgvUgPkkLt6d2PxG1gV8Z_fNWjS9+-1jkDWw@mail.gmail.com> <CAH2-Wz=75d0Yx-s15QNPN2sogfZK4PF7xOQFjPS8=Ca7C0f9+g@mail.gmail.com> <CAEze2WhHixewkTRLhGMoMPOGmXNJBLnVNt7FuxgFpmzdricR0A@mail.gmail.com> <CAEze2WiPNet+Ff7wbyFUpLUPzCgUvdsoNSdo_KLcriSaDGWpow@mail.gmail.com> <CAH2-WzkUaZesPygO4DCv4F7QG3BpMMfDmB42S+C_KPn-jaa+yA@mail.gmail.com> <CAEze2WiYOpAytLraPs72FV1MvOP1Q6vZx04zHj++-ZWyNBkqUg@mail.gmail.com> <CAH2-WznZ5ebfv96DqpKArBBcdnCUxkMOhFGipRA5mdhPKjVHsg@mail.gmail.com> <CAH2-WzmQUhfpSZrvcDmyk1OtydYv=TWRYJdp75m6=9hUaeHbFA@mail.gmail.com> <CAH2-WzkPOyZaMVtPUT19CfGwRndDekEBmGw_rd+UqKyK9n2LdQ@mail.gmail.com> <CAH2-Wz=vA9F1yS2gsc==EbV7rgJ21YyV0MEtV-Q_ELN9QPOD6g@mail.gmail.com> <0539d3d3-a402-0a49-ed5e-26429dffc4bd@gmail.com> <CAH2-Wz=sUDC5Y6uzKq8VOnhGgevaFF_j8-T+z240k72d8emXXg@mail.gmail.com> <ef0f7c8b-a6fa-362e-6fd6-054950f947ca@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