Re: possible wierd boolean bug? - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: possible wierd boolean bug?
Date
Msg-id 6EE64EF3AB31D5448D0007DD34EEB3412A756A@Herge.rcsinc.local
Whole thread Raw
In response to possible wierd boolean bug?  ("Merlin Moncure" <merlin.moncure@rcsonline.com>)
List pgsql-hackers
> > That is bizarre. Does EXPLAIN show any difference?
>
> Uh oh.
>
> esp=# reindex table data1.parts_order_line_file;

whoops, never mind that.  In fact, I re-indexed the wrong table.
Reindexing makes no difference.  Here, explain analyze and running query
in psql return different results.  Observe:

esp=# 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 ;int4 | id | lastmod | pol_po_no | pol_po_rel_no | pol_seq_no |
pol_parts_unit_no | pol_item_no | po
l_desc1 | pol_desc2 | pol_vendor_part_no | pol_qty_ordered |
pol_est_cost | pol_purchase_uom | pol_w
eight | pol_requested_date | pol_expected_date | pol_plant_loc_needed |
pol_workstation_needed | pol
_stock_loc_needed | pol_internal_contact | pol_update_unit_cost |
pol_gl_acct_no | pol_pur_to_inv_ra
tio | pol_print_rev_no | pol_revision_flag | pol_qty_received |
pol_parts_tracking_flag | pol_qty_re
jected
------+----+---------+-----------+---------------+------------+---------
----------+-------------+---
--------+-----------+--------------------+-----------------+------------
--+------------------+------
------+--------------------+-------------------+----------------------+-
-----------------------+----
------------------+----------------------+----------------------+-------
---------+------------------
----+------------------+-------------------+------------------+---------
----------------+-----------
-------
(0 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 ;
QUER
Y PLAN

------------------------------------------------------------------------
----------------------------
------------------------------------------------------------------------
----------------------------
--Limit  (cost=0.00..5.79 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.79 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)


pgsql-hackers by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: possible wierd boolean bug?
Next
From: Andrew Dunstan
Date:
Subject: Re: bgwriter changes