This is the MySQL table structure that I have:
itemID (BIGINT) userID (BIGINT) wasAdded (DATETIME)
I need to get the number of items introduced in the current day, by the X userID
What would be the most efficient way to do this?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The best way would be to add an index that covers
userIDandwasAdded, then you can doThis shouldn’t even need to read from the table, as all the data it needs is in the index.