X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 506398B9B39 for ; Mon, 7 Feb 2005 11:58:24 +0000 (GMT) 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 46225-07 for ; Mon, 7 Feb 2005 11:58:12 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.192]) by svr1.postgresql.org (Postfix) with ESMTP id DBA658B9D1A for ; Mon, 7 Feb 2005 11:58:13 +0000 (GMT) Received: by wproxy.gmail.com with SMTP id 71so875336wra for ; Mon, 07 Feb 2005 03:58:14 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=mAVhQDe1dY+dcl5wrMu3/nP8gEEg2S5ElH8NCVck/Ryc8L9S0fyRkh+50Z44fSe++W/pG1L/sa+k7xge5qFJ8Vp4FSngP3xuDXeeF+btVWz+vbk3H7LxhE/RNsVyd8lA7SD1rQSKC++WkkmRGQlUOk1b5JlAEbMiWD3OkbDiZLU= Received: by 10.54.32.55 with SMTP id f55mr181163wrf; Mon, 07 Feb 2005 03:58:14 -0800 (PST) Received: by 10.54.31.32 with HTTP; Mon, 7 Feb 2005 03:58:14 -0800 (PST) Message-ID: <2989532e05020703584989cd15@mail.gmail.com> Date: Mon, 7 Feb 2005 17:28:14 +0530 From: Antony Paul Reply-To: Antony Paul To: Jan Poslusny Subject: Re: Index not used with or condition Cc: pgsql-performance@postgresql.org In-Reply-To: <420756BA.4080507@gingerall.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <2989532e05020701073638ca4c@mail.gmail.com> <2989532e0502070314402057cc@mail.gmail.com> <420756BA.4080507@gingerall.cz> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.54 tagged_above=0 required=5 tests=AWL, FROM_ENDS_IN_NUMS, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200502/112 X-Sequence-Number: 10441 I ran analyze; several times. rgds Antony Paul On Mon, 07 Feb 2005 12:53:30 +0100, Jan Poslusny wrote: > It depends on many circumstances, but, at first, simple question: Did > you run vacuum analyze? > I am satisfied with functional indexes - it works in my pg 7.4.x. > > Antony Paul wrote: > > >On more investigation I found that index scan is not used if the query > >have a function in it like lower() and an index exist for lower() > >column. > > > >rgds > >Antony Paul > > > > > >On Mon, 7 Feb 2005 14:37:15 +0530, Antony Paul wrote: > > > > > >>Hi all, > >> I am facing a strange problem when I run EXPLAIN against a table > >>having more than 100000 records. The query have lot of OR conditions > >>and when parts of the query is removed it is using index. To analyse > >>it I created a table with a single column, inserted 100000 > >>records(random number) in it created index and run a query which > >>returns 1 record which have no or condition and it was using index. I > >>added an OR conditon and is using sequential scan. I set the > >>enable_seqscan to off. I ran the tests again and is using index scan. > >> So which one I have to use. Is this any bug in Explain. > >> > >>rgds > >>Antony Paul. > >> > >> > >> > > > >---------------------------(end of broadcast)--------------------------- > >TIP 3: if posting/reading through Usenet, please send an appropriate > > subscribe-nomail command to majordomo@postgresql.org so that your > > message can get through to the mailing list cleanly > > > > > > >