X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CF4ADD1B2BD for ; Sun, 25 Jul 2004 14:34:28 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 45776-07 for ; Sun, 25 Jul 2004 17:34:26 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id E809BD1B1B4 for ; Sun, 25 Jul 2004 14:34:24 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i6PHYLYk014660; Sun, 25 Jul 2004 13:34:21 -0400 (EDT) To: Markus Bertheau Cc: Jean-Luc Lachance , Keith Gallant , pgsql-sql@postgresql.org Subject: Re: SELECT from a list In-reply-to: <1090772515.9204.3.camel@teetnang> References: <1090763779.9204.1.camel@teetnang> <4103C656.4070109@sympatico.ca> <1090772515.9204.3.camel@teetnang> Comments: In-reply-to Markus Bertheau message dated "Sun, 25 Jul 2004 18:21:56 +0200" Date: Sun, 25 Jul 2004 13:34:21 -0400 Message-ID: <14659.1090776861@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/218 X-Sequence-Number: 18470 Markus Bertheau writes: > В Вск, 25.07.2004, в 16:40, Jean-Luc Lachance пишет: >> Better yet: >> >> SELECT * FROM table WHERE phrase ~ '^[0-9]'; > Not so sure if that's better - the regex engines aren't the fastest. [ raised eyebrow... ] I was under the impression that we had a pretty good one as of PG 7.4. Have you tested it lately? It is true that the above won't be indexable whereas the more tedious OR form potentially could use an index. This is not the fault of the regex engine however, but of limited understanding of regexes in the planner. regards, tom lane