INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Amazon MySQL AWS Cloud Database Query Performance

Amazon MySQL AWS Cloud Database Query Performance

Amazon MySQL AWS Cloud Database Query Performance

(OP)
Hi, I'm trying to perform a SELECT query on an Amazon hosted MySQL database.

My query looks like this:

CODE --> 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

RE: Amazon MySQL AWS Cloud Database Query Performance

Is description indexed too? is there any reason you use a text field rather than a set or an integer to denote the status?
Both would be faster.

But no, 15 minutes does not sound good. Try copying the dataset to a local underpowered dev machine and running it. On 20mn records I'd expect a second or so (but have not modeled this myself). I don't use Amazon aws so cannot comment more pointedly.

RE: Amazon MySQL AWS Cloud Database Query Performance

(OP)
Jpadie, appreciate the response.

Think the text field is the only one that serves my purpose but will look for an alternative but reassuring to hear that there is obviously something not right - my previous experience of in-house servers is closer to the 1 second you mention.

Thanks again.
Jacob

RE: Amazon MySQL AWS Cloud Database Query Performance

Assuming the text can be one of a given set of information (ie it is not free text), then a set/enum would be better wouldn't it?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close