From: | "Ismail Kizir" <ikizir(at)tumgazeteler(dot)com> |
---|---|
To: | <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Optimizer bug?? |
Date: | 2004-05-24 18:49:41 |
Message-ID: | 00ce01c441bf$e0269380$0100000a@bilmednot |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)dcc(dot)uchile(dot)cl>
To: "Ismail Kizir" <ikizir(at)tumgazeteler(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)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(at)postgresql(dot)org)
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Ismail Kizir | 2004-05-24 19:22:47 | Re: Optimizer bug?? |
Previous Message | Magnus Hagander | 2004-05-24 18:46:18 | Re: New horology failure |