On Thu, Apr 23, 2020 at 1:33 PM Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
I find the apparently
unnecessary cast in the partial-index predicate to be suspicious ---
maybe that's blocking matching to the WHERE clause?
I noticed that too...I suspect its related to the ANALYZE result:
Index Scan using idx_tabla_entidad on entidad (cost=0.56..51121.41
rows=1405216 width=20) (actual time=0.037..242.609 rows=1409985 loops=1)Index Cond: ((cod_tabla)::bigint = 4)
Since the index condition ended up cast to bigint the OP probably wrote the predicate to match.
David J.