Patent attributes
Techniques for capturing query execution statistics are disclosed. The disclosed system determines which queries are executing during a sampling interval. The system identifies related queries that share similarity criteria with the currently executing query. The system obtains query execution statistics for the query executing during the sampling interval and any related queries. The system generates or obtains statistics during a monitoring window that spans a longer period of time than a single intervening period between the current sampling interval and a prior interval. The statistics are stored in permanent storage or transmitted to a requesting computer. The system refrains from analyzing statistics for queries (and any related queries) that did not execute during a current sampling interval.