- PK is composed of 3 columns: mediumint,date,tinyint
Everything I wrote in initial post is about MyISAM. Since MyISAM uses table-lock instead of row-lock like InnoDB, locking out concurrent selects while inserting can make a huge difference in performance.
Most of the queries used all three components of primary key, but the 2nd and 3rd field are often queried in range. Table looks like this:
create table points (
Most queries are like:
select * from points where userid = ? and playdate = ? and game = ?
select * from points where userid = ? and playdate between ? and ?
Deleted records are mostly closer to the end of the table (in the last 1000 records or so).
OPTIMIZE TABLE runs way too slow to run it every day. Maybe weekly would be possible.