Patent attributes
A query processing device includes a communication interface accessing a database and database catalog, a memory storing instructions, and a processor coupled to the memory and the communication interface. The processor executes the instructions to parse a query and generate first and second execution plans for the query, retrieve respective previously determined cardinality values for previously executed logical steps of the first and second execution plans from the database catalog, select an execution plan from the first execution plan or the second execution plan, the selected execution plan having a lower cost based on the previously determined cardinality values, and execute the selected execution plan on data accessed from the database. The query processing system stores actual cardinality values determined during the execution of the logical steps in the database catalog for use by subsequent queries. The query processing device, therefore, re-uses previously determined cardinality values.