Re: possible bug - Mailing list pgsql-general

From Les
Subject Re: possible bug
Date
Msg-id CAKXe9UBWAML3_G66SBR2UZ3AVH1Bg5QBtYRTR0mLfwANyfxADw@mail.gmail.com
Whole thread Raw
In response to Re: possible bug  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general


So what happens if query the table directly?:

select * from wf.workflow  where head_table_id::float8::int8 = 25408438504;

vs

select * from wf.workflow  where head_table_id = 25408438504;


Both return lots of rows. The same number of rows.

select count(*) from wf.workflow  where head_table_id::float8::int8 = 25408438504;
count|
-----+
62260|

select count(*) from wf.workflow  where head_table_id = 25408438504;
count|
-----+
62260|

Both of them use seq scan.

QUERY PLAN                                                         |
-------------------------------------------------------------------+
Aggregate  (cost=2985.00..2985.01 rows=1 width=8)                  |
  ->  Seq Scan on workflow  (cost=0.00..2829.07 rows=62369 width=0)|
        Filter: (head_table_id = '25408438504'::bigint)            |

QUERY PLAN                                                                           |
-------------------------------------------------------------------------------------+
Aggregate  (cost=3289.86..3289.87 rows=1 width=8)                                    |
  ->  Seq Scan on workflow  (cost=0.00..3288.70 rows=460 width=0)                    |
        Filter: (((head_table_id)::double precision)::bigint = '25408438504'::bigint)|
 

pgsql-general by date:

Previous
From: Julie Nishimura
Date:
Subject: constantly updated table in Amazon RDS
Next
From: Tom Lane
Date:
Subject: Re: possible bug