Storage Container Optimization for Tables not partitioned
Version: 9.0.x
I see this message even for those tables with no partitions:
table source: v_monitor.query_events
event_type: STORAGE_CONTAINERS_ELIMINATED
event_details: "Using only 3 stores out of 6 for projection myschema.mytable_b0"
how is this possible? Does this mean I get the benefit of pruning even if the table is not partitioned?
Is the pruning coming from how the table's projection is segmented?
If this is true, then what is the difference between pruning from a partitioned table vs a non partitioned table?
0
Comments
Hi, even though the table is not explicitly partitioned, Vertica splits the data into ROS containers based on segmentation, see for example the diagram at https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/AdministratorsGuide/Partitions/PartitioningAndSegmentingData.htm
The catalog records what data are in each ROS container, so the query engine checks the catalog based on predicate and other query qualifiers and only reads from ROS containers that have relevant data according to the catalog.
Consider this simple reproducer:
So what is happening here? The two rows I insert are hashed into different ROS containers:
The catalog records that ROS #1 has row (1,1) while ROS#2 has row (3,3) and presumably records the lower and upper bounds of the integers stored in "a" and "b" in each. So when I query for "b=1", the catalog reports that only ROS#1 contains matching data, so we get the STORAGE_CONTAINERS_ELIMINATED operation message.