macbre/index-digest

Cache database meta-data

macbre opened this issue · 0 comments

  • cache the list of tables
  • cache the list of columns
  • cache the list of indices
  • cache EXPLAIN queries
  • cache MySQL server version

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