new queries to join statistics table