explain.depesz.com

A tool for finding a real cause for slow queries.

Result: ctq

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.406 152,430.326 ↑ 1.0 1 1

Aggregate (cost=44,604.28..44,604.30 rows=1 width=396) (actual time=152,430.325..152,430.326 rows=1 loops=1)

2. 0.008 159.328 ↑ 160.0 1 1

Nested Loop Left Join (cost=0.00..44,603.88 rows=160 width=396) (actual time=159.303..159.328 rows=1 loops=1)

  • Join Filter: (ds.docid = dm.docid)
3. 0.007 0.098 ↑ 4.0 1 1

Nested Loop (cost=0.00..50.56 rows=4 width=364) (actual time=0.076..0.098 rows=1 loops=1)

4. 0.006 0.060 ↑ 2.0 1 1

Nested Loop Left Join (cost=0.00..28.46 rows=2 width=98) (actual time=0.050..0.060 rows=1 loops=1)

  • Join Filter: (ds.docid = qdr.docid)
5. 0.007 0.028 ↑ 2.0 1 1

Append (cost=0.00..27.15 rows=2 width=66) (actual time=0.020..0.028 rows=1 loops=1)

6. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on documents_sourceinfo ds (cost=0.00..16.88 rows=1 width=66) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (docid = 1)
7. 0.020 0.020 ↑ 1.0 1 1

Index Scan using pk_documents_sourceinfo_0 on documents_sourceinfo_0 ds (cost=0.00..10.28 rows=1 width=65) (actual time=0.015..0.020 rows=1 loops=1)

  • Index Cond: (docid = 1)
8. 0.019 0.026 ↓ 0.0 0 1

Materialize (cost=0.00..1.27 rows=1 width=40) (actual time=0.026..0.026 rows=0 loops=1)

9. 0.007 0.007 ↓ 0.0 0 1

Seq Scan on querydocumentrelevance qdr (cost=0.00..1.27 rows=1 width=40) (actual time=0.007..0.007 rows=0 loops=1)

  • Filter: ((queryid = 10005) AND (docid = 1))
10. 0.011 0.031 ↑ 2.0 1 1

Materialize (cost=0.00..22.06 rows=2 width=274) (actual time=0.022..0.031 rows=1 loops=1)

11. 0.006 0.020 ↑ 2.0 1 1

Append (cost=0.00..22.05 rows=2 width=274) (actual time=0.014..0.020 rows=1 loops=1)

12. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on documents_rawdata dr (cost=0.00..13.12 rows=1 width=254) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (docid = 1)
13. 0.013 0.013 ↑ 1.0 1 1

Index Scan using pk_documents_rawdata_0 on documents_rawdata_0 dr (cost=0.00..8.93 rows=1 width=293) (actual time=0.010..0.013 rows=1 loops=1)

  • Index Cond: (docid = 1)
14. 0.007 159.222 ↓ 0.0 0 1

Materialize (cost=0.00..44,551.01 rows=40 width=40) (actual time=159.222..159.222 rows=0 loops=1)

15. 0.004 159.215 ↓ 0.0 0 1

Append (cost=0.00..44,550.81 rows=40 width=40) (actual time=159.215..159.215 rows=0 loops=1)

16. 0.009 0.009 ↓ 0.0 0 1

Index Scan using metadocid_idx on documentmetadata dm (cost=0.00..8.71 rows=1 width=46) (actual time=0.009..0.009 rows=0 loops=1)

  • Index Cond: (docid = 1)
  • Filter: (type = 'product_name'::text)
17. 159.202 159.202 ↓ 0.0 0 1

Seq Scan on documentmetadata_0 dm (cost=0.00..44,542.10 rows=39 width=40) (actual time=159.202..159.202 rows=0 loops=1)

  • Filter: ((type = 'product_name'::text) AND (docid = 1))
18.          

SubPlan (forAggregate)

19. 0.132 152,270.449 ↑ 1.0 1 1

Result (cost=2,669,140.71..2,669,140.72 rows=1 width=0) (actual time=152,270.447..152,270.449 rows=1 loops=1)

20.          

Initplan (forResult)

21. 1.527 152,270.317 ↑ 1.0 1 1

Aggregate (cost=15,922.00..2,669,140.71 rows=1 width=50) (actual time=152,270.316..152,270.317 rows=1 loops=1)

22. 0.214 169.430 ↑ 15.2 14 1

Nested Loop (cost=0.00..15,921.46 rows=213 width=50) (actual time=107.292..169.430 rows=14 loops=1)

  • Join Filter: (s.sentenceid = sc.sentenceid)
23. 0.077 168.474 ↑ 15.2 14 1

Nested Loop Left Join (cost=0.00..184.01 rows=213 width=16) (actual time=107.258..168.474 rows=14 loops=1)

  • Join Filter: (s.sentenceid = qspo.sentenceid)
24. 0.061 168.313 ↑ 15.2 14 1

Append (cost=0.00..172.35 rows=213 width=8) (actual time=107.181..168.313 rows=14 loops=1)

25. 43.485 43.485 ↓ 0.0 0 1

Index Scan using idx_sentences_docid on sentences_ids s (cost=0.00..13.53 rows=93 width=8) (actual time=43.485..43.485 rows=0 loops=1)

  • Index Cond: (docid = $5)
26. 63.733 63.733 ↑ 2.7 14 1

Index Scan using "idx_sentences_ids_0#docid" on sentences_ids_0 s (cost=0.00..130.06 rows=38 width=8) (actual time=63.686..63.733 rows=14 loops=1)

  • Index Cond: (docid = $5)
27. 26.176 26.176 ↓ 0.0 0 1

Index Scan using "idx_sentences_ids_1#docid" on sentences_ids_1 s (cost=0.00..9.42 rows=4 width=8) (actual time=26.176..26.176 rows=0 loops=1)

  • Index Cond: (docid = $5)
28. 5.649 5.649 ↓ 0.0 0 1

Index Scan using "idx_sentences_ids_2#docid" on sentences_ids_2 s (cost=0.00..9.90 rows=31 width=8) (actual time=5.649..5.649 rows=0 loops=1)

  • Index Cond: (docid = $5)
29. 29.209 29.209 ↓ 0.0 0 1

Index Scan using "idx_sentences_ids_3#docid" on sentences_ids_3 s (cost=0.00..9.45 rows=47 width=8) (actual time=29.209..29.209 rows=0 loops=1)

  • Index Cond: (docid = $5)
30. 0.023 0.084 ↓ 0.0 0 14

Materialize (cost=0.00..8.47 rows=1 width=16) (actual time=0.006..0.006 rows=0 loops=14)

31. 0.061 0.061 ↓ 0.0 0 1

Seq Scan on querysentencepolarityoverride qspo (cost=0.00..8.46 rows=1 width=16) (actual time=0.061..0.061 rows=0 loops=1)

  • Filter: (queryid = 10005)
32. 0.154 0.742 ↑ 1,134.0 1 14

Append (cost=0.00..59.71 rows=1,134 width=42) (actual time=0.014..0.053 rows=1 loops=14)

33. 0.014 0.014 ↓ 0.0 0 14

Seq Scan on sentences_classification sc (cost=0.00..21.30 rows=1,130 width=42) (actual time=0.001..0.001 rows=0 loops=14)

34. 0.196 0.196 ↑ 1.0 1 14

Index Scan using pk_sentences_classification_0 on sentences_classification_0 sc (cost=0.00..9.67 rows=1 width=42) (actual time=0.010..0.014 rows=1 loops=14)

  • Index Cond: (sc.sentenceid = s.sentenceid)
35. 0.168 0.168 ↓ 0.0 0 14

Index Scan using pk_sentences_classification_1 on sentences_classification_1 sc (cost=0.00..9.83 rows=1 width=42) (actual time=0.012..0.012 rows=0 loops=14)

  • Index Cond: (sc.sentenceid = s.sentenceid)
36. 0.098 0.098 ↓ 0.0 0 14

Index Scan using pk_sentences_classification_2 on sentences_classification_2 sc (cost=0.00..10.16 rows=1 width=42) (actual time=0.007..0.007 rows=0 loops=14)

  • Index Cond: (sc.sentenceid = s.sentenceid)
37. 0.112 0.112 ↓ 0.0 0 14

Index Scan using pk_sentences_classification_3 on sentences_classification_3 sc (cost=0.00..8.75 rows=1 width=42) (actual time=0.008..0.008 rows=0 loops=14)

  • Index Cond: (sc.sentenceid = s.sentenceid)
38.          

SubPlan (forAggregate)

39. 1.400 152,099.360 ↑ 1.0 1 14

Aggregate (cost=2,653,218.68..2,653,218.70 rows=1 width=20) (actual time=10,864.238..10,864.240 rows=1 loops=14)

40. 0.446 152,097.918 ↑ 4,839,880.0 4 14

Nested Loop (cost=0.00..2,604,819.88 rows=19,359,520 width=20) (actual time=3,398.197..10,864.137 rows=4 loops=14)

  • Join Filter: (sc.categoryid = c.categoryid)
41. 0.364 152,095.790 ↑ 63.0 4 14

Nested Loop (cost=0.00..2,597,596.21 rows=252 width=8) (actual time=3,398.173..10,863.985 rows=4 loops=14)

42. 112,524.454 112,524.454 ↑ 1.0 1 14

Seq Scan on sentences s (cost=0.00..1,154,919.45 rows=1 width=8) (actual time=0.204..8,037.461 rows=1 loops=14)

  • Filter: (sentenceid = $2)
43. 0.252 39,570.972 ↑ 63.0 4 14

Append (cost=0.00..1,442,674.24 rows=252 width=16) (actual time=2,826.460..2,826.498 rows=4 loops=14)

44. 39,570.076 39,570.076 ↓ 0.0 0 14

Seq Scan on sentencecategories sc (cost=0.00..1,442,133.20 rows=45 width=16) (actual time=2,826.434..2,826.434 rows=0 loops=14)

  • Filter: (sc.sentenceid = $2)
45. 0.350 0.350 ↑ 6.5 4 14

Index Scan using "idx_sentencecategories_0#sentenceid" on sentencecategories_0 sc (cost=0.00..42.89 rows=26 width=16) (actual time=0.020..0.025 rows=4 loops=14)

  • Index Cond: (sc.sentenceid = $2)
46. 0.098 0.098 ↓ 0.0 0 14

Index Scan using "idx_sentencecategories_1#sentenceid" on sentencecategories_1 sc (cost=0.00..28.98 rows=8 width=16) (actual time=0.007..0.007 rows=0 loops=14)

  • Index Cond: (sc.sentenceid = $2)
47. 0.098 0.098 ↓ 0.0 0 14

Index Scan using "idx_sentencecategories_2#sentenceid" on sentencecategories_2 sc (cost=0.00..358.17 rows=146 width=16) (actual time=0.007..0.007 rows=0 loops=14)

  • Index Cond: (sc.sentenceid = $2)
48. 0.098 0.098 ↓ 0.0 0 14

Index Scan using "idx_sentencecategories_3#sentenceid" on sentencecategories_3 sc (cost=0.00..111.00 rows=27 width=16) (actual time=0.007..0.007 rows=0 loops=14)

  • Index Cond: (sc.sentenceid = $2)
49. 0.522 1.682 ↑ 5.0 1 58

Append (cost=0.00..28.60 rows=5 width=37) (actual time=0.008..0.029 rows=1 loops=58)

50. 0.406 0.406 ↑ 1.0 1 58

Index Scan using pk_categories on categories c (cost=0.00..10.11 rows=1 width=27) (actual time=0.006..0.007 rows=1 loops=58)

  • Index Cond: (c.categoryid = sc.categoryid)
51. 0.348 0.348 ↓ 0.0 0 58

Index Scan using pk_categories_0 on categories_0 c (cost=0.00..9.66 rows=1 width=40) (actual time=0.006..0.006 rows=0 loops=58)

  • Index Cond: (c.categoryid = sc.categoryid)
52. 0.174 0.174 ↓ 0.0 0 58

Index Scan using pk_categories_1 on categories_1 c (cost=0.00..7.95 rows=1 width=40) (actual time=0.003..0.003 rows=0 loops=58)

  • Index Cond: (c.categoryid = sc.categoryid)
53. 0.116 0.116 ↓ 0.0 0 58

Index Scan using pk_categories_2 on categories_2 c (cost=0.00..0.44 rows=1 width=40) (actual time=0.002..0.002 rows=0 loops=58)

  • Index Cond: (c.categoryid = sc.categoryid)
54. 0.116 0.116 ↓ 0.0 0 58

Index Scan using pk_categories_3 on categories_3 c (cost=0.00..0.44 rows=1 width=40) (actual time=0.002..0.002 rows=0 loops=58)

  • Index Cond: (c.categoryid = sc.categoryid)
55.          

SubPlan (forAggregate)

56. 0.042 0.042 ↑ 1.0 1 14

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.002..0.003 rows=1 loops=14)

57. 0.013 0.140 ↑ 1.0 1 1

Result (cost=198.08..198.09 rows=1 width=0) (actual time=0.139..0.140 rows=1 loops=1)

58.          

Initplan (forResult)

59. 0.018 0.127 ↑ 1.0 1 1

Aggregate (cost=198.07..198.08 rows=1 width=14) (actual time=0.126..0.127 rows=1 loops=1)

60. 0.016 0.109 ↑ 5.0 1 1

Nested Loop (cost=0.00..198.05 rows=5 width=14) (actual time=0.063..0.109 rows=1 loops=1)

  • Join Filter: (a.authorid = da.authorid)
61. 0.021 0.061 ↑ 5.0 1 1

Append (cost=0.00..63.85 rows=5 width=8) (actual time=0.031..0.061 rows=1 loops=1)

62. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on documentauthors da (cost=0.00..28.88 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (docid = $5)
63. 0.018 0.018 ↑ 1.0 1 1

Index Scan using "idx_documentauthors_0#docid" on documentauthors_0 da (cost=0.00..8.80 rows=1 width=8) (actual time=0.017..0.018 rows=1 loops=1)

  • Index Cond: (docid = $5)
64. 0.007 0.007 ↓ 0.0 0 1

Index Scan using "idx_documentauthors_1#docid" on documentauthors_1 da (cost=0.00..8.82 rows=1 width=8) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: (docid = $5)
65. 0.007 0.007 ↓ 0.0 0 1

Index Scan using "idx_documentauthors_2#docid" on documentauthors_2 da (cost=0.00..8.82 rows=1 width=8) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: (docid = $5)
66. 0.007 0.007 ↓ 0.0 0 1

Index Scan using "idx_documentauthors_3#docid" on documentauthors_3 da (cost=0.00..8.53 rows=1 width=8) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: (docid = $5)
67. 0.006 0.032 ↑ 3.0 1 1

Append (cost=0.00..26.80 rows=3 width=22) (actual time=0.020..0.032 rows=1 loops=1)

68. 0.007 0.007 ↓ 0.0 0 1

Index Scan using pk_authors on authors a (cost=0.00..9.07 rows=1 width=22) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: (a.authorid = da.authorid)
69. 0.011 0.011 ↑ 1.0 1 1

Index Scan using pk_authors_0 on authors_0 a (cost=0.00..9.11 rows=1 width=22) (actual time=0.010..0.011 rows=1 loops=1)

  • Index Cond: (a.authorid = da.authorid)
70. 0.008 0.008 ↓ 0.0 0 1

Index Scan using pk_authors_1 on authors_1 a (cost=0.00..8.63 rows=1 width=21) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: (a.authorid = da.authorid)
71. 0.003 0.003 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.002..0.003 rows=1 loops=1)