Fix key max length is 1000 bytes for mysql, plus fields length consistency
Quick integration of the analytics SQL queries. Warning, they are working on the old tables formats, to be updated.