1. A method comprising: calculating traffic statistics associated with packet flows through a network; storing the traffic statistics within a flow table; maintaining a heap that provides a heap-ordered representation of at least a portion of the traffic statistics of the packet flows within the flow table, wherein the heap is a tree having a root node and a plurality of other nodes arranged as parent nodes and child nodes, each of the nodes storing traffic statistics for a different one of the packet flows, and wherein the tree is heap-ordered in that a value for the traffic statistics stored in any child node of the tree is less than or equal to a value for the traffic statistics stored for its parent node within the tree; receiving a query from a client; processing the heap in response to the query to select one or more of the nodes of the tree while continuing to update the traffic flow statistics in the flow table in response to network traffic; and outputting the traffic statistics associated with the selected nodes of the tree to the client.