X-Original-To: pgsql-bugs-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 3E8789FA7B6 for ; Tue, 4 Jul 2006 15:16:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 66169-07 for ; Tue, 4 Jul 2006 15:15:57 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 8D7129FA4A5 for ; Tue, 4 Jul 2006 15:15:57 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k64IFsC7025495; Tue, 4 Jul 2006 14:15:55 -0400 (EDT) To: Tomasz Ostrowski cc: pgsql-bugs@postgresql.org Subject: Re: query very slow when enable_seqscan=on In-reply-to: <20060704144406.GA21511@batory.org.pl> References: <20060703203105.GA2801@batory.org.pl> <7353.1151967946@sss.pgh.pa.us> <20060704083733.GA20102@batory.org.pl> <13853.1152021389@sss.pgh.pa.us> <20060704144406.GA21511@batory.org.pl> Comments: In-reply-to Tomasz Ostrowski message dated "Tue, 04 Jul 2006 16:44:08 +0200" Date: Tue, 04 Jul 2006 14:15:54 -0400 Message-ID: <25494.1152036954@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/21 X-Sequence-Number: 15366 Tomasz Ostrowski writes: > So why estimate regex expressions if there is no estimation possible? > Let's set this estimate to be pessimistic (match everything or > everything not null) and it will choose better plans. Better plans for this specific example, worse plans for other cases. Life is not that simple. regards, tom lane