This article explains why two SQL queries used to verify row distribution in Vertica may return different results, even when targeting the same partition. It highlights the role of segmentation expressions and system metadata in understanding data placement across nodes.
Environment
- Vertica Analytics Platform
- Table:
ttd.BidFeedback_AttributionGrains_BRID_b1 - Segmentation:
SEGMENTED BY hash(AdvertiserId, BidRequestId) ALL NODES - Partitioning:
PARTITION BY date(LogEntryTime)
Situation
A user compares two queries to verify row distribution for a specific partition (2025-08-09) and finds that the row counts do not match:
- A query using the hash function to group rows by shard.
- A query using system metadata from the
partitionstable to count rows per node.