Created
January 3, 2011 21:22
-
-
Save MisterPhoton/763987 to your computer and use it in GitHub Desktop.
Notifier Query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET @cutoff = date_add(now(), interval 421 MINUTE); | |
EXPLAIN SELECT | |
wpi.itemId, | |
wpi.label, | |
wpi.note, | |
wpi.dueDate, | |
wp.timeZone, | |
su.email, | |
su.firstName, | |
su.lastName | |
FROM | |
Wedding_Plan_Item AS wpi | |
JOIN Wedding_Plan AS wp USING(planId) | |
JOIN System_User AS su USING(userId) | |
WHERE | |
wpi.deleted = 0 AND | |
wpi.reminderSendDate is not null AND | |
wpi.reminderSentDate is null AND | |
wpi.reminderSendDate < @cutoff; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
EXPLAIN results: