Use memoize decorator / https://medium.com/@nkhaja/memoization-and-decorators-with-python-32f607439f84
Queries performed when running make demo
- before the fix: 101
- after the fix: 67
Repeated queries
EXPLAIN select count(*) from 0002_not_used_indices where foo = 'foo'
EXPLAIN select * from 0002_not_used_indices where bar = 'foo'
EXPLAIN select * from 0002_not_used_indices order by id
EXPLAIN select * from 0002_not_used_indices where foo = 'foo' and id = 2
EXPLAINqueriesUse
memoizedecorator / https://medium.com/@nkhaja/memoization-and-decorators-with-python-32f607439f84Queries performed when running
make demoRepeated queries