explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HtMR

Settings
# exclusive inclusive rows x rows loops node
1. 1.165 1,052.193 ↓ 2.9 10,000 1

Subquery Scan t (cost=10,622.14..10,749.82 rows=3,405 width=68) (actual time=1,044.850..1,052.193 rows=10,000 loops=1)

2. 193.982 1,051.028 ↓ 2.9 10,000 1

HashAggregate (cost=10,622.14..10,715.77 rows=3,405 width=112) (actual time=1,044.848..1,051.028 rows=10,000 loops=1)

3. 65.523 857.046 ↓ 28.6 97,548 1

Hash Join (cost=10,205.49..10,545.52 rows=3,405 width=112) (actual time=744.718..857.046 rows=97,548 loops=1)

  • Hash Cond: ("outer".session_id = "inner".id)
4. 25.847 784.510 ↓ 31.2 113,520 1

Merge Join (cost=9,917.84..10,001.51 rows=3,638 width=44) (actual time=737.691..784.510 rows=113,520 loops=1)

  • Merge Cond: ("outer"."?column1?" = "inner".tag_id)
5. 0.257 15.931 ↑ 5.2 373 1

Sort (cost=1,186.01..1,190.86 rows=1,940 width=56) (actual time=15.895..15.931 rows=373 loops=1)

  • Sort Key: min(tags.id)
6. 9.304 15.674 ↑ 5.2 373 1

HashAggregate (cost=1,046.12..1,080.07 rows=1,940 width=56) (actual time=15.572..15.674 rows=373 loops=1)

7. 1.541 6.370 ↑ 1.0 18,841 1

Append (cost=0.00..609.82 rows=19,391 width=56) (actual time=0.004..6.370 rows=18,841 loops=1)

8. 0.005 0.005 ↑ 900.0 1 1

Seq Scan on ta_tags (cost=0.00..19.00 rows=900 width=56) (actual time=0.004..0.005 rows=1 loops=1)

9. 4.824 4.824 ↓ 1.0 18,840 1

Seq Scan on ta_default_tags (cost=0.00..396.91 rows=18,491 width=40) (actual time=0.002..4.824 rows=18,840 loops=1)

10. 183.790 742.732 ↓ 302.7 113,520 1

Sort (cost=8,731.84..8,732.77 rows=375 width=8) (actual time=721.792..742.732 rows=113,520 loops=1)

  • Sort Key: st.tag_id
11. 16.439 558.942 ↓ 302.7 113,520 1

Subquery Scan st (cost=8,711.12..8,715.80 rows=375 width=8) (actual time=524.859..558.942 rows=113,520 loops=1)

12. 263.964 542.503 ↓ 302.7 113,520 1

Sort (cost=8,711.12..8,712.05 rows=375 width=20) (actual time=524.857..542.503 rows=113,520 loops=1)

  • Sort Key: tmp.session_id, min(tmp.static_tag_id), min(tmp.parent_tag_id), min(tmp.default_tag_id)
13. 96.562 278.539 ↓ 302.7 113,520 1

HashAggregate (cost=8,685.71..8,695.08 rows=375 width=20) (actual time=241.610..278.539 rows=113,520 loops=1)

14. 9.546 181.977 ↓ 30.3 113,520 1

Append (cost=1,401.21..8,573.30 rows=3,747 width=12) (actual time=59.693..181.977 rows=113,520 loops=1)

15. 0.000 0.001 ↓ 0.0 0 1

Subquery Scan "*SELECT* 1" (cost=1,401.21..1,442.20 rows=94 width=12) (actual time=0.001..0.001 rows=0 loops=1)

16. 0.000 0.001 ↓ 0.0 0 1

Hash Join (cost=1,401.21..1,441.26 rows=94 width=12) (actual time=0.001..0.001 rows=0 loops=1)

  • Hash Cond: ("outer".tag_id = "inner".id)
17. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on ta_session_tags tst (cost=0.00..29.40 rows=1,940 width=8) (actual time=0.001..0.001 rows=0 loops=1)

18. 0.000 0.000 ↓ 0.0 0

Hash (cost=1,401.10..1,401.10 rows=44 width=12) (never executed)

19. 0.000 0.000 ↓ 0.0 0

Merge Join (cost=1,379.36..1,401.10 rows=44 width=12) (never executed)

  • Merge Cond: (("outer".tag_type_id = "inner".tag_type_id) AND ("outer"."?column4?" = "inner"."?column4?"))
20. 0.000 0.000 ↓ 0.0 0

Sort (cost=63.16..65.41 rows=900 width=40) (never executed)

  • Sort Key: tt.tag_type_id, (tt.name)::text
21. 0.000 0.000 ↓ 0.0 0

Seq Scan on ta_tags tt (cost=0.00..19.00 rows=900 width=40) (never executed)

22. 0.000 0.000 ↓ 0.0 0

Sort (cost=1,316.20..1,321.05 rows=1,940 width=40) (never executed)

  • Sort Key: tet.tag_type_id, (tet.name)::text
23. 0.000 0.000 ↓ 0.0 0

Subquery Scan tet (cost=1,186.01..1,210.26 rows=1,940 width=40) (never executed)

24. 0.000 0.000 ↓ 0.0 0

Sort (cost=1,186.01..1,190.86 rows=1,940 width=56) (never executed)

  • Sort Key: min(tags.id)
25. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=1,046.12..1,080.07 rows=1,940 width=56) (never executed)

26. 0.000 0.000 ↓ 0.0 0

Append (cost=0.00..609.82 rows=19,391 width=56) (never executed)

27. 0.000 0.000 ↓ 0.0 0

Seq Scan on ta_tags (cost=0.00..19.00 rows=900 width=56) (never executed)

28. 0.000 0.000 ↓ 0.0 0

Seq Scan on ta_default_tags (cost=0.00..396.91 rows=18,491 width=40) (never executed)

29. 0.000 0.007 ↓ 0.0 0 1

Subquery Scan "*SELECT* 2" (cost=1,429.41..1,476.91 rows=68 width=12) (actual time=0.007..0.007 rows=0 loops=1)

30. 0.006 0.007 ↓ 0.0 0 1

Hash Join (cost=1,429.41..1,476.23 rows=68 width=12) (actual time=0.007..0.007 rows=0 loops=1)

  • Hash Cond: ("outer".interface_id = "inner".parent_channel_id)
31. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=1,401.21..1,441.26 rows=94 width=12) (never executed)

  • Hash Cond: ("outer".tag_id = "inner".id)
32. 0.000 0.000 ↓ 0.0 0

Seq Scan on child_session_tags cst (cost=0.00..29.40 rows=1,940 width=8) (never executed)

33. 0.000 0.000 ↓ 0.0 0

Hash (cost=1,401.10..1,401.10 rows=44 width=12) (never executed)

34. 0.000 0.000 ↓ 0.0 0

Merge Join (cost=1,379.36..1,401.10 rows=44 width=12) (never executed)

  • Merge Cond: (("outer".tag_type_id = "inner".tag_type_id) AND ("outer"."?column4?" = "inner"."?column4?"))
35. 0.000 0.000 ↓ 0.0 0

Sort (cost=63.16..65.41 rows=900 width=40) (never executed)

  • Sort Key: tt.tag_type_id, (tt.name)::text
36. 0.000 0.000 ↓ 0.0 0

Seq Scan on ta_tags tt (cost=0.00..19.00 rows=900 width=40) (never executed)

37. 0.000 0.000 ↓ 0.0 0

Sort (cost=1,316.20..1,321.05 rows=1,940 width=40) (never executed)

  • Sort Key: tet.tag_type_id, (tet.name)::text
38. 0.000 0.000 ↓ 0.0 0

Subquery Scan tet (cost=1,186.01..1,210.26 rows=1,940 width=40) (never executed)

39. 0.000 0.000 ↓ 0.0 0

Sort (cost=1,186.01..1,190.86 rows=1,940 width=56) (never executed)

  • Sort Key: min(tags.id)
40. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=1,046.12..1,080.07 rows=1,940 width=56) (never executed)

41. 0.000 0.000 ↓ 0.0 0

Append (cost=0.00..609.82 rows=19,391 width=56) (never executed)

42. 0.000 0.000 ↓ 0.0 0

Seq Scan on ta_tags (cost=0.00..19.00 rows=900 width=56) (never executed)

43. 0.000 0.000 ↓ 0.0 0

Seq Scan on ta_default_tags (cost=0.00..396.91 rows=18,491 width=40) (never executed)

44. 0.000 0.001 ↓ 0.0 0 1

Hash (cost=27.84..27.84 rows=144 width=8) (actual time=0.001..0.001 rows=0 loops=1)

45. 0.001 0.001 ↓ 0.0 0 1

Hash Join (cost=11.00..27.84 rows=144 width=8) (actual time=0.001..0.001 rows=0 loops=1)

  • Hash Cond: ("outer".channel_id = "inner".id)
46. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on ta_sessions tst (cost=0.00..13.60 rows=360 width=8) (actual time=0.000..0.000 rows=0 loops=1)

47. 0.000 0.000 ↓ 0.0 0

Hash (cost=10.80..10.80 rows=80 width=8) (never executed)

48. 0.000 0.000 ↓ 0.0 0

Seq Scan on interfaces i (cost=0.00..10.80 rows=80 width=8) (never executed)

49. 17.096 172.423 ↓ 31.7 113,520 1

Subquery Scan "*SELECT* 3" (cost=3,184.28..5,654.19 rows=3,585 width=12) (actual time=59.684..172.423 rows=113,520 loops=1)

50. 71.187 155.327 ↓ 31.7 113,520 1

Hash Join (cost=3,184.28..5,618.34 rows=3,585 width=12) (actual time=59.684..155.327 rows=113,520 loops=1)

  • Hash Cond: ("outer".default_tag_id = "inner".id)
51. 24.474 24.474 ↓ 1.0 113,520 1

Seq Scan on ta_default_session_tags st (cost=0.00..1,840.14 rows=111,614 width=8) (actual time=0.009..24.474 rows=113,520 loops=1)

52. 4.359 59.666 ↓ 31.7 18,840 1

Hash (cost=3,182.79..3,182.79 rows=594 width=12) (actual time=59.666..59.666 rows=18,840 loops=1)

53. 8.461 55.307 ↓ 31.7 18,840 1

Merge Join (cost=3,023.62..3,182.79 rows=594 width=12) (actual time=44.806..55.307 rows=18,840 loops=1)

  • Merge Cond: (("outer".tag_type_id = "inner".tag_type_id) AND ("outer"."?column4?" = "inner"."?column4?"))
54. 25.308 30.093 ↓ 1.0 18,840 1

Sort (cost=1,707.42..1,753.64 rows=18,491 width=24) (actual time=29.208..30.093 rows=18,840 loops=1)

  • Sort Key: tt.tag_type_id, (tt.value)::text
55. 4.785 4.785 ↓ 1.0 18,840 1

Seq Scan on ta_default_tags tt (cost=0.00..396.91 rows=18,491 width=24) (actual time=0.002..4.785 rows=18,840 loops=1)

56. 1.507 16.753 ↓ 9.7 18,781 1

Sort (cost=1,316.20..1,321.05 rows=1,940 width=40) (actual time=15.594..16.753 rows=18,781 loops=1)

  • Sort Key: tet.tag_type_id, (tet.name)::text
57. 0.074 15.246 ↑ 5.2 373 1

Subquery Scan tet (cost=1,186.01..1,210.26 rows=1,940 width=40) (actual time=15.150..15.246 rows=373 loops=1)

58. 0.221 15.172 ↑ 5.2 373 1

Sort (cost=1,186.01..1,190.86 rows=1,940 width=56) (actual time=15.148..15.172 rows=373 loops=1)

  • Sort Key: min(tags.id)
59. 9.296 14.951 ↑ 5.2 373 1

HashAggregate (cost=1,046.12..1,080.07 rows=1,940 width=56) (actual time=14.843..14.951 rows=373 loops=1)

60. 1.485 5.655 ↑ 1.0 18,841 1

Append (cost=0.00..609.82 rows=19,391 width=56) (actual time=0.002..5.655 rows=18,841 loops=1)

61. 0.002 0.002 ↑ 900.0 1 1

Seq Scan on ta_tags (cost=0.00..19.00 rows=900 width=56) (actual time=0.002..0.002 rows=1 loops=1)

62. 4.168 4.168 ↓ 1.0 18,840 1

Seq Scan on ta_default_tags (cost=0.00..396.91 rows=18,491 width=40) (actual time=0.001..4.168 rows=18,840 loops=1)

63. 3.142 7.013 ↑ 1.1 10,000 1

Hash (cost=260.40..260.40 rows=10,899 width=72) (actual time=7.013..7.013 rows=10,000 loops=1)

64. 3.871 3.871 ↑ 1.1 10,000 1

Seq Scan on collected_ta_sessions (cost=0.00..260.40 rows=10,899 width=72) (actual time=0.011..3.871 rows=10,000 loops=1)

  • Filter: (NOT disabled)