greatly refined mysql schema, performance improvements