added canonized query maching and counters for them