Add extra query to extension_relation_counts log