From: Tom Lane <tgl@sss.pgh.pa.us>
To: Benjamin Minshall <minshall@intellicon.biz>
Cc: pgsql-performance@postgresql.org
Subject: Re: Performance of IN (...) vs. = ANY array[...]
Date: Fri, 15 Sep 2006 16:19:21 -0400
Message-ID: <5373.1158351561@sss.pgh.pa.us> (raw)
In-Reply-To: <450AFB07.5050600@intellicon.biz>
References: <450AFB07.5050600@intellicon.biz>
Benjamin Minshall <minshall@intellicon.biz> writes:
> What are the advantages or disadvantages of using arrays in this
> situation? The = ANY array method makes plpgsql development cleaner,
> but seems to really lack performance in certain cases.
In existing releases, the form with IN (list-of-scalar-constants)
can be optimized into indexscan(s), but = ANY (array) isn't.
8.2 will treat them equivalently (in fact, it converts IN (...) to
= ANY (ARRAY[...]) !). So depending on your time horizon, you might
wish to stick with whichever is cleaner for your calling code.
regards, tom lane
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, minshall@intellicon.biz
Subject: Re: Performance of IN (...) vs. = ANY array[...]
In-Reply-To: <5373.1158351561@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