Re: possible wierd boolean bug?

From: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: possible wierd boolean bug?
Date: 2004-12-14 14:37:55
Message-ID: 6EE64EF3AB31D5448D0007DD34EEB3412A7567@Herge.rcsinc.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce wrote:
> That is bizarre. Does EXPLAIN show any difference?
>
>
------------------------------------------------------------------------
--

esp=# explain analyze select 1::int4, * from data1.po_line_file
esp-# where pol_po_no = '00000002' and
esp-# (pol_po_no = '00000002' and pol_po_rel_no = 0) and
esp-# (pol_po_no = '00000002' and pol_po_rel_no = 0 and
pol_item_no = '1570')
esp-# limit 1 ;

QUER
Y PLAN

------------------------------------------------------------------------
----------------------------
------------------------------------------------------------------------
----------------------------
--
Limit (cost=0.00..5.76 rows=1 width=313) (actual time=0.000..0.000
rows=0 loops=1)
-> Index Scan using po_line_file_pkey on po_line_file
(cost=0.00..5.76 rows=1 width=313) (actua
l time=0.000..0.000 rows=0 loops=1)
Index Cond: ((pol_po_no = '00000002'::bpchar) AND (pol_po_no =
'00000002'::bpchar) AND (pol
_po_no = '00000002'::bpchar) AND ((pol_po_rel_no)::smallint = 0) AND
((pol_po_rel_no)::smallint = 0)
)
Filter: ((pol_item_no)::text = '1570'::text)
Total runtime: 0.000 ms
(5 rows)

esp=# explain analyze select 1::int4, * from data1.po_line_file
esp-# where -- pol_po_no = '00000002' and
esp-# -- (pol_po_no = '00000002' and pol_po_rel_no = 0) and
esp-# (pol_po_no = '00000002' and pol_po_rel_no = 0 and
pol_item_no = '1570')
esp-# limit 1 ;
QUERY
PLAN

------------------------------------------------------------------------
----------------------------
------------------------------------
Limit (cost=0.00..5.75 rows=1 width=313) (actual time=0.000..0.000
rows=1 loops=1)
-> Index Scan using po_line_file_pkey on po_line_file
(cost=0.00..5.75 rows=1 width=313) (actua
l time=0.000..0.000 rows=1 loops=1)
Index Cond: ((pol_po_no = '00000002'::bpchar) AND
((pol_po_rel_no)::smallint = 0))
Filter: ((pol_item_no)::text = '1570'::text)
Total runtime: 0.000 ms
(5 rows)

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2004-12-14 14:40:15 Re: possible wierd boolean bug?
Previous Message Tom Lane 2004-12-14 14:23:27 Re: bgwriter changes