Reputation: 23
Is there any way to tell if the zone map is used by a specific query. Is there a way to list block query read
My query is taking more time than expected, I just want to make the sure the query is using zone map to filter out blocks.
Upvotes: 1
Views: 593
Reputation: 14035
The table stl_scan
contains this information.
is_rrscan
indicates if the scan used range restriction (zone maps).rows_pre_user_filter
is the row count before zone map restrictionsrows_pre_filter
is the row count after zone map restrictionsrows
is the row count after all predicates were evaluatedSELECT query, segment
, tbl, perm_table_name
, is_rrscan
, SUM( rows_pre_user_filter ) rows_on_table
, SUM( rows_pre_filter ) rows_scanned
, SUM( rows ) rows_returned
FROM stl_scan
WHERE query = 999999
GROUP BY 1,2,3,4,5
ORDER BY 1,2,3,4,5
Upvotes: 2