Re: [HACKERS] path toward faster partition pruning

From: Marina Polyakova <m(dot)polyakova(at)postgrespro(dot)ru>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Amit Langote <amitlangote09(at)gmail(dot)com>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] path toward faster partition pruning
Date: 2018-05-04 09:32:23
Message-ID: ff8f9bfa485ff961d6bb43e54120485b@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello everyone in this thread!

I got a similar server crash as in [1] on the master branch since the
commit 9fdb675fc5d2de825414e05939727de8b120ae81 when the assertion fails
because the second argument ScalarArrayOpExpr is not a Const or an
ArrayExpr, but is an ArrayCoerceExpr (see [2]):

=# create table list_parted (
a varchar
) partition by list (a);
=# create table part_ab_cd partition of list_parted for values in ('ab',
'cd');
=# CREATE OR REPLACE FUNCTION public.x_stl_text_integer (
)
RETURNS text STABLE AS
$body$
BEGIN
RAISE NOTICE 's text integer';
RETURN 1::text;
END;
$body$
LANGUAGE 'plpgsql';
=# explain (costs off) select * from list_parted where a in ('ab', 'cd',
x_stl_text_integer());
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!>

[1]
https://www.postgresql.org/message-id/CAKcux6nCsCmu9oUnnuKZkeBenYvUFbU2Lt4q2MFNEb7QErzn8w%40mail.gmail.com

[2] partprune.c, function match_clause_to_partition_key:
if (IsA(rightop, Const))
{
...
}
else
{
ArrayExpr *arrexpr = castNode(ArrayExpr, rightop); # fails here
...
}

--
Marina Polyakova
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2018-05-04 09:39:15 Re: nbtsort.c performs unneeded (though harmless) truncation
Previous Message Andrey Borodin 2018-05-04 09:26:56 Re: [HACKERS] Clock with Adaptive Replacement