Created
April 17, 2020 15:18
-
-
Save EdwardIII/2d45ab140dd26994473156f4f5baea12 to your computer and use it in GitHub Desktop.
Entries 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
// These are all the queries being run | |
// also this is a bit slow | |
[10s] SELECT "entries".* FROM "entries" WHERE "entries"."referrer" = $1 ORDER BY "entries"."created_at" DESC [["referrer", "http://localhost"]] | |
[10s] SELECT COUNT(*) FROM "entries" WHERE "entries"."referrer" = $1 AND "entries"."widget_id" = $2 AND (content -> 'action' ? 'open' and content -> 'type' ? 'slide_callout') AND (created_at >= '1970-04-17 14:57:56.675928' AND created_at <= '2020-04-17 14:57:59.557860') [["referrer", "http://localhost"], ["widget_id", 1]] | |
[10s] SELECT COUNT(*) FROM "entries" WHERE "entries"."referrer" = $1 [["referrer", "http://localhost"]] | |
// this one seems to be the culprit | |
[10s] SELECT "entries".* FROM "entries" WHERE "entries"."referrer" = $1 AND (extract(year from created_at) = '2020') AND (extract(month from created_at) = '04') ORDER BY "entries"."created_at" DESC [["referrer", "http://localhost"]] |
oluyoung
commented
Apr 17, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment