Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tmbUu-00800o-1x for pgsql-general@arkaria.postgresql.org; Mon, 24 Feb 2025 16:40:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tmbUt-004wxp-1w for pgsql-general@arkaria.postgresql.org; Mon, 24 Feb 2025 16:39:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tmbUs-004wxh-LR for pgsql-general@lists.postgresql.org; Mon, 24 Feb 2025 16:39:58 +0000 Received: from mail-il1-x12e.google.com ([2607:f8b0:4864:20::12e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tmbUp-000ZHP-2y for pgsql-general@lists.postgresql.org; Mon, 24 Feb 2025 16:39:58 +0000 Received: by mail-il1-x12e.google.com with SMTP id e9e14a558f8ab-3d2af701446so38113615ab.2 for ; Mon, 24 Feb 2025 08:39:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740415194; x=1741019994; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QRoVzgdjMk1bj79PnPxXqAp6SqvtBWqRt392j+Rqu6U=; b=EDbES56VsQ9LyDljFYGxamRDUZ5TFr1mpvmedAnoqkjFWXHNV+yQYY95Ger1YXWj/H 6NAMk0CPmegIFFBrWkWJB6kYVFIF/JJ49PSVn7OxGFKP9OBKYDmVW80xoK2xRqbZcqDH ehyaQn2/F+GKGmLPuUaxoaDrj09tdbWNeyMp6KM7LnD19cGCIe0xPnmJstnLwEoI7Nze N1LFMfYSrGDJgFguEuo6JANeyatSwWMmlZatpE3TH+63nYZw2L1uv1KCp3X5yoM02g34 d/i24gCnSVGFYBxnxChpCwoddDIjcdG8yoZ8kCCb2Gyek/g3MD6REENQdIsrdvTLtewC gYZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740415194; x=1741019994; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QRoVzgdjMk1bj79PnPxXqAp6SqvtBWqRt392j+Rqu6U=; b=lmU1e+AylLXIzQWkcgYCyH1gRP33RLaANM2WkpI0JEgFj28j9rh7yY7pfTF+JKbfZH UzkNh5KH2zPBaFH5nMgvYtR+zdLe0sS5CY/TdPBBMojX3MepteBfC3QTXjgJKtYt4TvX hesXNBnSSZOKL8p3igIbnhREjYgdc1CH8ODQjJ7nA+6TtdUjD2zAMwrIJqMbCq9GdRgt tfT0dofR4b26y+hiNJJhf1GyMFbS5XXNZvUtNB8ym6CTD+dUOa8/vi+749cMvQD1RjgE z9HhbGlO8TUHDfseeaeMOmBihgwjdg8mdwLNpPVMUh398aBgNDvY+KDyTwWb3uHB/T0g eu5A== X-Gm-Message-State: AOJu0Yyx5IOSXroOXuv+1aoVSNComGM5zOFrlGAouaKuWsMhkEE7R0NA 8fg/h35XufnAR91A1pJ9SOA1NJ11Jy+NYGzOM0yPSSgWyNjBYAor6ycJfH2OCo32zvOWV1OKw3K D3sZeejadbME/Zo1GW9hguJXq9kU= X-Gm-Gg: ASbGncvgSOAhmcKyoVSZtK2+947TJVA+1N90VnlBrT5LyKVHFN5aV3n10k6sw6ELvhL r1t98QrZbCP1v6w6SDNvI8Yz7oHhSsg/qP+RtC0VCVUWjqngAUKNix0Zs4TxbDMZ6ADHXKYIMNj WrjWlkwANvZ4M1GbyNx+zuGOX21hMAImoPHP8tWvi11g== X-Google-Smtp-Source: AGHT+IEmsveFMvwSLF6CvYRETX554O2WS5UxnuSbOjWxYnGpuAlEL2+zYQHEqzHC0wgWhvKk5VgJmMDkP5OUq+3qUyM= X-Received: by 2002:a05:6e02:b2b:b0:3d0:4e0c:2c96 with SMTP id e9e14a558f8ab-3d2cae4edd4mr139056065ab.2.1740415194275; Mon, 24 Feb 2025 08:39:54 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Greg Sabino Mullane Date: Mon, 24 Feb 2025 11:39:15 -0500 X-Gm-Features: AWEUYZkWn3qRLW3g5mrqbZy3h12ORwcYZHXpeeKLNNsk1InBsTX9c91RS9igML4 Message-ID: Subject: Re: Keep specialized query pairs, or use single more general but more complex one To: Dominique Devienne Cc: pgsql-general@lists.postgresql.org, andrew@tao11.riddles.org.uk Content-Type: multipart/alternative; boundary="0000000000006aa9ca062ee5fd6a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000006aa9ca062ee5fd6a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 24, 2025 at 4:46=E2=80=AFAM Dominique Devienne wrote: > But now we have a new requirement, for "fuzzy find". I.e. the client can > ask for names > which are not the exact in-DB names, but also aliases of those names. > ... > join unnest($3::text[]) with ordinality as aliases(name, ord) on c.name = =3D > aliases.name > I'm not seeing how this is supposed to work, if these aliases are not in the database somewhere. Maybe an example? How does "Alli" get mapped to a c.name of "Allison"? Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Software Products & Tech Support --0000000000006aa9ca062ee5fd6a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Feb 24, 2025 at 4:46=E2=80=AFAM D= ominique Devienne <ddevienne@gmai= l.com> wrote:
=
But= now we have a new requirement, for "fuzzy find". I.e. the client= can ask for names
which are not the exact in-DB names, but also = aliases of those names.
...=C2=A0
join unnes= t($3::text[]) with ordinality as aliases(name, ord) on c.name =3D aliases.name

= I'm not seeing how this is supposed to work, if these aliases are not i= n the database somewhere. Maybe an example? How does "Alli" get m= apped to a=C2=A0c.name of "Allison"= ?

=C2=A0
Cheers,
Greg

--
Enterprise Pos= tgres Software Products & Tech Support

=
--0000000000006aa9ca062ee5fd6a--