I have a query in the following format: select id from table1 group by id having count(id) < 2;
table1 is a log table that gets written to by a trigger. We run a monitor every 2 hours and the query above is what the monitor executes. In about a week, the table has grown to approximately 100,000 rows.
I am debating whether an index is necessary on the table? On one hand, I am thinking since this table is written to a lot, I want the least overhead possible. On the other hand, i'm thinking if it is worth indexing on the ID column for a monitor that runs every 2 hours? For now, the monitor takes about 80 milliseconds to execute.
Can you give me some advice on what my best steps should be? Thank you
By Peachy 16 asked Jun 29, 2015 at 03:00 PM