public inbox for [email protected]  
help / color / mirror / Atom feed
From: Greg Sabino Mullane <[email protected]>
To: Dominique Devienne <[email protected]>
Cc: [email protected]
Cc: [email protected]
Subject: Re: Keep specialized query pairs, or use single more general but more complex one
Date: Mon, 24 Feb 2025 12:36:10 -0500
Message-ID: <CAKAnmm+su9VJh5nQ3GTS88W5nJUyqFw-JrVuEj9q7mbSG0HCFw@mail.gmail.com> (raw)
In-Reply-To: <CAFCRh-_6tqs3CF-Wf=AytJ6-_8-wq=9Tz02E7jQSk-mnRRm--w@mail.gmail.com>
References: <CAFCRh-9SDUvcrF_RigOzXsbOm=8mHmzy2OSC1ejQNcjmfXXM_Q@mail.gmail.com>
	<CAKAnmmJeA-oXD-nOuqpi6EoSogmsgPAW-5puwN1scdc-snEC9g@mail.gmail.com>
	<CAFCRh-_6tqs3CF-Wf=AytJ6-_8-wq=9Tz02E7jQSk-mnRRm--w@mail.gmail.com>

On Mon, Feb 24, 2025 at 11:50 AM Dominique Devienne <[email protected]>
wrote:

> We lookup whether there's a list of aliases for "Allison". If there are,
> we send them in $3 as an array

of string (e.g. ['All', 'Alli', ...], and the first one matching (thanks to
> order by ord limit 1) is returned, if any.
>

Thanks, I understand it now. While the unnest will create a different plan,
it should fundamentally be the same. The join order will not matter. The
only consideration is if the unnest list grows very, very large, which
seems unlikely given your situation. And yes, it should be fine to set the
first name as the leading item in the array and only run a single query for
both cases.

As always, it's best to test on your data and your exact queries, but from
here it seems sane.

Cheers,
Greg

--
Crunchy Data - https://www.crunchydata.com
Enterprise Postgres Software Products & Tech Support


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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Keep specialized query pairs, or use single more general but more complex one
  In-Reply-To: <CAKAnmm+su9VJh5nQ3GTS88W5nJUyqFw-JrVuEj9q7mbSG0HCFw@mail.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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox