Query optimization

Query optimization consists of reducing the engine's work: selecting only the useful columns, filtering early, leveraging partitioning and clustering, avoiding unnecessary joins and precomputing frequent aggregates. It is measured from the execution plan and the volume of data read, not only from elapsed time.

Example

SELECT id_client, montant FROM fait_ventes WHERE date_vente = '2025-03-01';  -- rather than SELECT *

Related concepts

The whole glossary