Improvements
- Improve query performance of filtering by a factor of >= 10x (see #335)
💡 Migration Notice
For anyone running Wakapi with MySQL, it is recommended (not required) to perform the following steps to drastically speed up schema migrations required for 2.2.5
.
- Stop Wakapi
- Run the below SQL query
- Pull new version and start Wakapi again
set unique_checks=0;
set foreign_key_checks=0;
alter table `heartbeats`
modify column `project` varchar(191),
modify column `branch` varchar(191),
modify column `language` varchar(191),
modify column `editor` varchar(191),
modify column `operating_system` varchar(191),
modify column `machine` varchar(191),
modify column `origin` varchar(255),
modify column `origin_id` varchar(255),
modify column `user_agent` varchar(255);
Explanation (for techies): Some new database indexes have been introduced and MySQL requires indexed VARCHAR
columns to be of a max length of 191 characters. To alter the columns' type, MySQL first copies the whole table to a temporary one, which can be extremely slow, depending on the table size. You can either let GORM (Wakapi's ORM library) perform these migrations the moment you start up Wakapi. But GORM will execute each ALTER TABLE ... MODIFY COLUMN
separately, i.e. will result in the heartbeats
table being copied 9 times as opposed to only once when running the above command manually. This process can still take very long, for Wakapi.dev it took close to 4 hours.