v.23.5Performance Improvement

Optimize query_log tables with LowCardinality for improved performance

Optimize the system.query_log and system.query_thread_log tables by applying LowCardinality when appropriate. The queries over these tables will be faster. #49530 (Alexey Milovidov).