From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexey Klyukin <alexk@hintbits.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Lack of index usage when doing array casts
Date: Fri, 21 Feb 2014 14:04:57 -0500
Message-ID: <5576.1393009497@sss.pgh.pa.us> (raw)
In-Reply-To: <CAAS3ty+GD9xfh4M4OiGLSQxHRyQGUS1VUaofdxqCn0A=_z4rRw@mail.gmail.com>
References: <CAAS3ty+GD9xfh4M4OiGLSQxHRyQGUS1VUaofdxqCn0A=_z4rRw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Alexey Klyukin <alexk@hintbits.com> writes:
> We had a problem with PostgreSQL not using an index scan in 2 similar
> queries, the only difference between them is the array cast from text[] to
> location_type[] (array of enum values).
Hmm. IIRC the text to enum cast is considered stable not immutable, which
is why that doesn't get folded to a Const on sight. However, it seems
like it'd be okay for scalararraysel() to reduce stable expressions for
estimation purposes, ie it should be using estimate_expression_value.
regards, tom lane
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
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, alexk@hintbits.com
Subject: Re: Lack of index usage when doing array casts
In-Reply-To: <5576.1393009497@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