Re: possible bug

From: Les <nagylzs(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: possible bug
Date: 2022-10-21 18:55:28
Message-ID: CAKXe9UBWAML3_G66SBR2UZ3AVH1Bg5QBtYRTR0mLfwANyfxADw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)|

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2022-10-21 19:05:31 Re: possible bug
Previous Message Julie Nishimura 2022-10-21 18:51:54 constantly updated table in Amazon RDS