95bd778fcc
The only way to get reasonable performance out of all three databases (mariadb, mysql, postgres) appears to be to make the following changes: * Use group-by instead of distinct. Some versions of mysql produce the wrong output with distinct; this is more descriptive of what we want anyway. * Split the query into two statements instead of joining on a subquery. Mariadb seems to be unable to produce a good query plan for the buildset list query. Neither mariadb nor mysql support using "IN" with a subquery (so the idea of using IN instead of JOIN for the subquery is out). These methods now perform a query to get the ids of the builds or buildsets that match the criteria, then perform a second query to load the ORM objects that match those ids. This appears to be quite fast for all three queries with the latest versions of all three database systems. Change-Id: I30bb3214807dfa8b26a848f85bb7a7bc660c6c1d |
||
---|---|---|
.. | ||
alembic | ||
__init__.py | ||
alembic.ini | ||
sqlconnection.py | ||
sqlreporter.py |