Re: Optimizer bug?? - Mailing list pgsql-hackers

From Ismail Kizir
Subject Re: Optimizer bug??
Date
Msg-id 00ce01c441bf$e0269380$0100000a@bilmednot
Whole thread Raw
In response to Optimizer bug??  ("Ismail Kizir" <ikizir@tumgazeteler.com>)
List pgsql-hackers
Alvaro,

For the query :
EXPLAIN SELECT count(tarih) AS c FROM articletbl WHERE sitekodu = 12 AND     ((tarih>='2004-04-24' AND
tarih<'2004-05-24'))
 

QUERY PLAN is
Aggregate  (cost=41619.34..41619.34 rows=1 width=4) ->  Seq Scan on articletbl  (cost=0.00..41618.46 rows=353 width=4)
    Filter: ((sitekodu = 12) AND (tarih >= '2004-04-24'::date) AND
 
(tarih < '2004-05-24'::date))

And for the query :

EXPLAIN SELECT count(tarih) AS c FROM articletbl WHERE sitekodu = 12 AND     ((tarih>='2004-05-10' AND
tarih<'2004-05-24'))
 

QUERY PLAN
Aggregate  (cost=20279.72..20279.72 rows=1 width=4) ->  Index Scan using ind_articletbltrh on articletbl
(cost=0.00..20279.40
rows=127 width=4)       Index Cond: ((tarih >= '2004-05-10'::date) AND (tarih <
'2004-05-24'::date))       Filter: (sitekodu = 12)

Have you got an idea?

Thanks in advance
Ismail Kizir
----- Original Message -----
From: "Alvaro Herrera" <alvherre@dcc.uchile.cl>
To: "Ismail Kizir" <ikizir@tumgazeteler.com>
Cc: <pgsql-hackers@postgresql.org>
Sent: Monday, May 24, 2004 9:23 PM
Subject: Re: [HACKERS] Optimizer bug??


> On Mon, May 24, 2004 at 08:27:01PM +0300, Ismail Kizir wrote:
>
> > The optimizer does an indexed scan up to 20 days, and then, it decides
to
> > make a sequential scan.
> > But i am still not sure about the efficiency of this decision.
>
> Huh, so what was the EXPLAIN ANALYZE of the query with BETWEEN?
>
> --
> Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
> Syntax error: function hell() needs an argument.
> Please choose what hell you want to involve.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
>




pgsql-hackers by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: New horology failure
Next
From: Gaetano Mendola
Date:
Subject: Re: Optimizer bug??