dracidoupe / graveyard

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

Tavern Performance Optimizations #305

Open Almad opened 3 years ago

Almad commented 3 years ago

After experimenting with EXPLAIN, there is no working around the fact that any GROUP BY id on Tavern Tables causes MySQL to go on and use temporary table for sorting. To avoid it:

Almad commented 3 years ago

There is, of course, discrepancy between how TavernBookmark and TavernTableVisitor data is maintained:

mysql> select count(oblibenost), oblibenost from putyka_uzivatele group by oblibenost; 
+-------------------+------------+
| count(oblibenost) | oblibenost |
+-------------------+------------+
|             13011 |          1 |
|             52596 |          0 |
|              8559 |         -1 |
|                 1 |       4584 |
|                 1 |       6193 |
|                 1 |       5561 |
|                 1 |      15394 |
+-------------------+------------+
7 rows in set (0.06 sec)

mysql> select count(*) from putyka_book;
+----------+
| count(*) |
+----------+
|    13251 |
+----------+
1 row in set (0.00 sec)

mysql>