barnettjacob
IS-IT--Management
Hi, I'm trying to perform a SELECT query on an Amazon hosted MySQL database.
My query looks like this:
The table in question is about 20m records of which about half fit the 'signed in' criteria and the output of the query would likely be about 350k rows. Both columns are indexed (if that makes a difference).
The problem is that performance is incredibly slow - its been running for over 15 minutes and has yet to resolve! Am I being unreasonable in expecting it to run quicker than this? My ultimate goal is to use this as part of a larger 'user' query that adds this column to extra user data but there's little chance of that working when this simple won't!
Any advice welcome.
Jacob
My query looks like this:
SQL:
select
user_id,
max(created_at)
from marketing_events
where description = 'signed in'
group by user_id
The table in question is about 20m records of which about half fit the 'signed in' criteria and the output of the query would likely be about 350k rows. Both columns are indexed (if that makes a difference).
The problem is that performance is incredibly slow - its been running for over 15 minutes and has yet to resolve! Am I being unreasonable in expecting it to run quicker than this? My ultimate goal is to use this as part of a larger 'user' query that adds this column to extra user data but there's little chance of that working when this simple won't!
Any advice welcome.
Jacob