dracidoupe / graveyard

Open Source reimplementation of https://www.dracidoupe.cz/
https://nove.dracidoupe.cz/
MIT License
6 stars 4 forks source link

Denormalize number of comments on a tavern table #234

Open Almad opened 3 years ago

Almad commented 3 years ago

On my computer:

List of tables = ~6ms List of tables with number of comments = ~211ms

Looking into the guts of the SQL query, it's done well, this is really because of a count, group and join on a table that has ~300k rows.

This needs denormalization and caching :)

First start is to have number of comments as an attribute on the table and maintain it using increments / triggers / well even Django signals would work better than this.

Follows up on list from #210