I've got a table with a bunch of columns. Among them facility_id
and po_date
. I'm writing a complex query and I have an index on those two columns. You can see from the planner output below that Postgres is using that index as the index condition when it's joining to my facility
table.
My question is actually in regards to the presence of columns enumerated in the Filter:
line below. exclude
, verified
, and deleted
are not in the index referenced at the top and so how is Postgres actually getting at the data in those columns? I would've expected a full table scan to be explicitly cited however there isn't one in sight anywhere. Can a full table scan be quietly hidden in a Filter
?
This table is 50M rows in size, and I'm on Postgres 10. Also, this portion of the query is in a CTE.
-> Index Scan using clustered_table_facility_id_po_date_idx on clustered_table cp (cost=0.56..1401.08 rows=31929 width=37) (actual time=0.021..5.331 rows=9572 loops=3640) Index Cond: (facility_id = af.id) Filter: ((NOT exclude) AND (verified IS NULL) AND (deleted IS NULL)) Rows Removed by Filter: 2819