In this StarTree Recipe, Mark Needham explains how to merge segments in real-time tables in Apache Pinot, which we want to do as small segments can lead to higher query latency. He demonstrates how to use the kcat tool to setup the Pinot schema, followed by the table config, which includes the MergeRollupTask. After checking data ingestion through the Pinot UI, Mark shows how to manually run the MergeRollupTask, and what it looks like when the segments are merged successfully. This process, when done properly, can improve query performance significantly.