Skip to content

Instantly share code, notes, and snippets.

@lettergram
Last active August 19, 2018 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lettergram/a939bdfb90499cab628ef16a12a9cc5b to your computer and use it in GitHub Desktop.
Save lettergram/a939bdfb90499cab628ef16a12a9cc5b to your computer and use it in GitHub Desktop.
Slow & Semi-Accurate Full-Text Search in PostgreSQL
SELECT story_url, count(*) as count, max(updated_at) as updated_at
FROM "comments"
WHERE ("comments"."updated_at" BETWEEN '2018-01-01' AND '2018-07-06')
AND (comment_text LIKE '%google%')
GROUP BY story_url, story_title HAVING (count(*) > '7')
ORDER BY count DESC LIMIT 15;
Planning time: 0.472 ms
Execution time: 42839.333 ms
/* WHERE ("comments"."updated_at" BETWEEN '2018-07-01' AND '2018-07-06') */
https://medium.com/@serverpunch/why-you-should-not-use-google-cloud-75ea2aec00de | 34 |
2018-07-01 01:39:39 | 2018-07-01 12:30:09
https://github.com/harababurel/gcsf | 9 | 2018-07-01 02:35:09 | 2018-07-01 17:30:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment