Tue Nov 17
Research into keeping the latest x rows
You cant delete with a skip/take (some mysql limitation)
DELETE FROM `apiLogs`
WHERE id <= (
    SELECT id
    FROM (
        SELECT id
        FROM `apiLogs`
        ORDER BY id DESC
        LIMIT 1 OFFSET 42 -- keep this many records
    ) foo
)
Ended up going with a more generic version as rather than start from now we can just start at zero and delete up to the count we're looking for.
SELECT
    `id`
FROM
    `apiLogs`
WHERE
    `application_id` NOT in('SAGESYNC', 'SAGESYNCMS', 'SAGESYNCXC4')
ORDER BY
    `created_at` ASC
LIMIT 3500