Skip to content

Instantly share code, notes, and snippets.

@souen
Created May 15, 2012 18:05
Show Gist options
  • Select an option

  • Save souen/2703795 to your computer and use it in GitHub Desktop.

Select an option

Save souen/2703795 to your computer and use it in GitHub Desktop.
Slow queries Sesql
# 6s
2012-05-15 19:59:43 CEST LOG: duration: 6309.370 ms statement: SELECT classname, id
FROM sesql_default
WHERE (workflow_state = 20) AND (fulltext_tsv @@ plainto_tsquery('public.lem_french', E'ayrault ')) AND (classname IN (E'Article',E'Slideshow',E'Media',E'Pointer',E'Chat',E'Forum')) AND (workflow_state = 20) AND (editorial_source IN (20,10)) AND (publication_date >= E'2011-11-17')
ORDER BY publication_date_time DESC
LIMIT 1000
# 56s
2012-05-15 19:54:33 CEST LOG: duration: 56736.021 ms statement: SELECT classname, id
FROM sesql_default
WHERE (workflow_state = 20) AND (fulltext_tsv @@ plainto_tsquery('public.lem_french', E'juge')) AND (classname IN (E'Article',E'Slideshow',E'Media',E'Pointer',E'Chat',E'Forum')) AND (workflow_state = 20) AND (editorial_source IN (20,10)) AND (publication_date >= E'2011-11-17')
ORDER BY publication_date_time DESC
LIMIT 1000
# 25s
2012-05-15 20:17:59 CEST LOG: duration: 25753.959 ms statement: SELECT classname, id
FROM sesql_default
WHERE (workflow_state = 20) AND (fulltext_tsv @@ plainto_tsquery('public.lem_french', E'grand paris')) AND (classname IN (E'Article',E'Slideshow',E'Media',E'Pointer',E'Chat',E'Forum')) AND (workflow_state = 20) AND (editorial_source IN (20,10)) AND (publication_date >= E'2011-11-17')
ORDER BY publication_date_time DESC
LIMIT 1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment