Files
cloudkitty/releasenotes/notes/optimizing-sql-queries-939f48fff1805389.yaml
Olivier Chaze 10a9482a91 Optimizing SQL queries that filter on a time range
Queries filtering on date fields are slow as they have to parse each
row. There are sometimes millions of rows to parse while only a few
thousands are necessary.

The following patch narrows data to process by filtering more on
frame_model.begin as a firtst step using a `BETWEEN` statement instead
of >=

Change-Id: I8acbc8946d9e001419f7bf5064fcebe0a0ae907a
Depends-On: Ia6908d13c91a02c47863ae6ac4b595ac98f9fd91
2023-03-06 08:14:10 -03:00

11 lines
483 B
YAML

---
features:
- |
Queries filtering on date fields are slow as they have to parse each row.
There are sometimes millions of rows to parse while only a few thousands
are necessary.
The following patch narrows data to process by filtering more on
frame_model.begin as a firtst step using a `BETWEEN` statement instead
of >=
The BETWEEN statement requires an indexes to be efficient which are
https://review.opendev.org/c/openstack/cloudkitty/+/865435/