Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
for questions specific to data types that contain both date and time parts.
0
votes
3
answers
370
views
How to re-write this query or restructure my table for SPEED
I have an InnoDB MySQL table of this structure:
column
type
service
varchar(16)
url
varchar(255)
datetime
datetime
It contains logs for requests made to one of multiple services. … It outputs this:
service
lastMonthCount
API A
3056752
API B
38451
I have indexes on datetime and service. I can see they are of type BTREE. …
1
vote
Accepted
How to re-write this query or restructure my table for SPEED
I remove the index on service and the index on datetime, adding a composite index on (datetime, service) instead. Ordering of the columns in that index matters. This took the query from ~28s to ~14s. …