I am trying to figure out the Big-Oh performance of the following query:
SELECT *
FROM table1 INNER JOIN table2 ON table1.a = table2.b
GROUP BY table1.a
table1.a is the primary key of the table. table2.b has a non-unique index on it.
My thought is since each index can be searched in O(log n), then this query performs in O(log n * log m) where n is the number of rows in table 1 and m is the number of rows in table 2.
Any input would be appreciated.