explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HxsfT

Settings
# exclusive inclusive rows x rows loops node
1. 339.173 1,111.474 ↑ 5.8 7,623 1

Gather Merge (cost=1,809.19..280,047.04 rows=44,307 width=14,668) (actual time=22.736..1,111.474 rows=7,623 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 3.986 772.301 ↑ 7.3 2,541 3 / 3

Nested Loop Left Join (cost=809.17..273,932.88 rows=18,461 width=14,660) (actual time=5.496..772.301 rows=2,541 loops=3)

3. 4.862 755.610 ↑ 7.3 2,541 3 / 3

Nested Loop Left Join (cost=808.89..265,862.03 rows=18,461 width=13,264) (actual time=5.482..755.610 rows=2,541 loops=3)

4. 7.267 732.961 ↑ 7.3 2,541 3 / 3

Nested Loop Left Join (cost=808.48..250,774.22 rows=18,461 width=11,876) (actual time=5.467..732.961 rows=2,541 loops=3)

5. 3.467 707.907 ↑ 7.3 2,541 3 / 3

Nested Loop Left Join (cost=808.07..235,686.41 rows=18,461 width=10,488) (actual time=5.450..707.907 rows=2,541 loops=3)

6. 2.676 691.735 ↑ 7.3 2,541 3 / 3

Nested Loop Left Join (cost=807.79..227,832.27 rows=18,461 width=9,092) (actual time=5.436..691.735 rows=2,541 loops=3)

7. 4.211 676.354 ↑ 7.3 2,541 3 / 3

Nested Loop Left Join (cost=807.51..221,959.12 rows=18,461 width=7,868) (actual time=5.421..676.354 rows=2,541 loops=3)

8. 1.969 661.979 ↑ 7.3 2,541 3 / 3

Nested Loop Left Join (cost=807.23..213,888.26 rows=18,461 width=6,472) (actual time=5.404..661.979 rows=2,541 loops=3)

9. 1.903 639.682 ↑ 7.3 2,541 3 / 3

Nested Loop Left Join (cost=806.82..198,800.45 rows=18,461 width=5,084) (actual time=5.387..639.682 rows=2,541 loops=3)

10. 4.723 617.451 ↑ 7.3 2,541 3 / 3

Nested Loop Left Join (cost=806.41..183,712.64 rows=18,461 width=3,696) (actual time=5.347..617.451 rows=2,541 loops=3)

11. 3.597 602.564 ↑ 7.3 2,541 3 / 3

Nested Loop Left Join (cost=806.13..175,858.50 rows=18,461 width=2,300) (actual time=5.313..602.564 rows=2,541 loops=3)

12. 578.728 583.721 ↑ 7.3 2,541 3 / 3

Parallel Index Scan using idx_trx_created_timestamp on tbl_transaction transactio0_ (cost=805.84..169,985.35 rows=18,461 width=1,076) (actual time=5.229..583.721 rows=2,541 loops=3)

  • Filter: (((application)::text = ANY ('{MRT,ORD}'::text[])) AND ((status)::text = 'TODO'::text) AND (((hashed SubPlan 3) AND ((application)::text = 'MRT'::text)) OR ((hashed SubPlan 6) AND ((application)::text = 'ORD'::text)) OR (hashed SubPlan 9)))
  • Rows Removed by Filter: 515212
13.          

SubPlan (for Parallel Index Scan)

14. 1.039 1.073 ↓ 0.0 0 3 / 3

Seq Scan on tbl_site site11_ (cost=34.32..259.57 rows=3,562 width=37) (actual time=1.073..1.073 rows=0 loops=3)

  • Filter: ((hashed SubPlan 1) OR (hashed SubPlan 2))
  • Rows Removed by Filter: 4758
15.          

SubPlan (for Seq Scan)

16. 0.000 0.023 ↓ 0.0 0 3 / 3

Nested Loop (cost=0.57..16.61 rows=1 width=37) (actual time=0.023..0.023 rows=0 loops=3)

17. 0.023 0.023 ↓ 0.0 0 3 / 3

Index Scan using idx_user_access_2_user on tbl_user_access useraccess12_ (cost=0.29..8.30 rows=1 width=37) (actual time=0.023..0.023 rows=0 loops=3)

  • Index Cond: ((user_id)::text = '58375063-937d-4694-9282-dd1b34e587ae'::text)
  • Filter: (active AND ((type)::text = 'MRT'::text))
  • Rows Removed by Filter: 1
18. 0.000 0.000 ↓ 0.0 0 / 3

Index Only Scan using tbl_site_pkey on tbl_site site13_ (cost=0.28..8.30 rows=1 width=37) (never executed)

  • Index Cond: (id = (useraccess12_.site_id)::text)
  • Heap Fetches: 0
19. 0.000 0.011 ↓ 0.0 0 3 / 3

Nested Loop (cost=1.13..17.70 rows=2 width=37) (actual time=0.011..0.011 rows=0 loops=3)

20. 0.000 0.011 ↓ 0.0 0 3 / 3

Nested Loop (cost=0.85..17.05 rows=1 width=37) (actual time=0.011..0.011 rows=0 loops=3)

  • Join Filter: ((useraccess14_.site_id)::text = (company16_.main_site_id)::text)
21. 0.000 0.011 ↓ 0.0 0 3 / 3

Nested Loop (cost=0.57..16.61 rows=1 width=74) (actual time=0.011..0.011 rows=0 loops=3)

22. 0.011 0.011 ↓ 0.0 0 3 / 3

Index Scan using idx_user_access_2_user on tbl_user_access useraccess14_ (cost=0.29..8.30 rows=1 width=37) (actual time=0.011..0.011 rows=0 loops=3)

  • Index Cond: ((user_id)::text = '58375063-937d-4694-9282-dd1b34e587ae'::text)
  • Filter: (active AND ((type)::text = 'MRT'::text))
  • Rows Removed by Filter: 1
23. 0.000 0.000 ↓ 0.0 0 / 3

Index Only Scan using tbl_site_pkey on tbl_site site15_ (cost=0.28..8.30 rows=1 width=37) (never executed)

  • Index Cond: (id = (useraccess14_.site_id)::text)
  • Heap Fetches: 0
24. 0.000 0.000 ↓ 0.0 0 / 3

Index Scan using idx_company_2_main_site on tbl_company company16_ (cost=0.28..0.43 rows=1 width=74) (never executed)

  • Index Cond: ((main_site_id)::text = (site15_.id)::text)
25. 0.000 0.000 ↓ 0.0 0 / 3

Index Scan using idx_site_2_company on tbl_site site17_ (cost=0.28..0.63 rows=2 width=74) (never executed)

  • Index Cond: ((company_id)::text = (company16_.id)::text)
26. 1.272 1.296 ↓ 0.0 0 3 / 3

Seq Scan on tbl_site site18_ (cost=34.32..259.57 rows=3,562 width=37) (actual time=1.296..1.296 rows=0 loops=3)

  • Filter: ((hashed SubPlan 4) OR (hashed SubPlan 5))
  • Rows Removed by Filter: 4758
27.          

SubPlan (for Seq Scan)

28. 0.000 0.015 ↓ 0.0 0 3 / 3

Nested Loop (cost=0.57..16.61 rows=1 width=37) (actual time=0.015..0.015 rows=0 loops=3)

29. 0.015 0.015 ↓ 0.0 0 3 / 3

Index Scan using idx_user_access_2_user on tbl_user_access useraccess19_ (cost=0.29..8.30 rows=1 width=37) (actual time=0.015..0.015 rows=0 loops=3)

  • Index Cond: ((user_id)::text = '58375063-937d-4694-9282-dd1b34e587ae'::text)
  • Filter: (active AND ((type)::text = 'ORD'::text))
  • Rows Removed by Filter: 1
30. 0.000 0.000 ↓ 0.0 0 / 3

Index Only Scan using tbl_site_pkey on tbl_site site20_ (cost=0.28..8.30 rows=1 width=37) (never executed)

  • Index Cond: (id = (useraccess19_.site_id)::text)
  • Heap Fetches: 0
31. 0.000 0.009 ↓ 0.0 0 3 / 3

Nested Loop (cost=1.13..17.70 rows=2 width=37) (actual time=0.009..0.009 rows=0 loops=3)

32. 0.001 0.009 ↓ 0.0 0 3 / 3

Nested Loop (cost=0.85..17.05 rows=1 width=37) (actual time=0.009..0.009 rows=0 loops=3)

  • Join Filter: ((useraccess21_.site_id)::text = (company23_.main_site_id)::text)
33. 0.000 0.008 ↓ 0.0 0 3 / 3

Nested Loop (cost=0.57..16.61 rows=1 width=74) (actual time=0.008..0.008 rows=0 loops=3)

34. 0.008 0.008 ↓ 0.0 0 3 / 3

Index Scan using idx_user_access_2_user on tbl_user_access useraccess21_ (cost=0.29..8.30 rows=1 width=37) (actual time=0.008..0.008 rows=0 loops=3)

  • Index Cond: ((user_id)::text = '58375063-937d-4694-9282-dd1b34e587ae'::text)
  • Filter: (active AND ((type)::text = 'ORD'::text))
  • Rows Removed by Filter: 1
35. 0.000 0.000 ↓ 0.0 0 / 3

Index Only Scan using tbl_site_pkey on tbl_site site22_ (cost=0.28..8.30 rows=1 width=37) (never executed)

  • Index Cond: (id = (useraccess21_.site_id)::text)
  • Heap Fetches: 0
36. 0.000 0.000 ↓ 0.0 0 / 3

Index Scan using idx_company_2_main_site on tbl_company company23_ (cost=0.28..0.43 rows=1 width=74) (never executed)

  • Index Cond: ((main_site_id)::text = (site22_.id)::text)
37. 0.000 0.000 ↓ 0.0 0 / 3

Index Scan using idx_site_2_company on tbl_site site24_ (cost=0.28..0.63 rows=2 width=74) (never executed)

  • Index Cond: ((company_id)::text = (company23_.id)::text)
38. 2.384 2.624 ↑ 24.1 148 3 / 3

Seq Scan on tbl_site site25_ (cost=34.32..259.57 rows=3,562 width=37) (actual time=0.787..2.624 rows=148 loops=3)

  • Filter: ((hashed SubPlan 7) OR (hashed SubPlan 8))
  • Rows Removed by Filter: 4610
39.          

SubPlan (for Seq Scan)

40. 0.004 0.039 ↑ 1.0 1 3 / 3

Nested Loop (cost=0.57..16.61 rows=1 width=37) (actual time=0.038..0.039 rows=1 loops=3)

41. 0.013 0.013 ↑ 1.0 1 3 / 3

Index Scan using idx_user_access_2_user on tbl_user_access useraccess26_ (cost=0.29..8.30 rows=1 width=37) (actual time=0.012..0.013 rows=1 loops=3)

  • Index Cond: ((user_id)::text = '58375063-937d-4694-9282-dd1b34e587ae'::text)
  • Filter: (active AND ((type)::text = 'ALL'::text))
42. 0.022 0.022 ↑ 1.0 1 3 / 3

Index Only Scan using tbl_site_pkey on tbl_site site27_ (cost=0.28..8.30 rows=1 width=37) (actual time=0.022..0.022 rows=1 loops=3)

  • Index Cond: (id = (useraccess26_.site_id)::text)
  • Heap Fetches: 0
43. 0.022 0.201 ↓ 74.0 148 3 / 3

Nested Loop (cost=1.13..17.70 rows=2 width=37) (actual time=0.089..0.201 rows=148 loops=3)

44. 0.004 0.070 ↑ 1.0 1 3 / 3

Nested Loop (cost=0.85..17.05 rows=1 width=37) (actual time=0.069..0.070 rows=1 loops=3)

  • Join Filter: ((useraccess28_.site_id)::text = (company30_.main_site_id)::text)
45. 0.004 0.024 ↑ 1.0 1 3 / 3

Nested Loop (cost=0.57..16.61 rows=1 width=74) (actual time=0.023..0.024 rows=1 loops=3)

46. 0.011 0.011 ↑ 1.0 1 3 / 3

Index Scan using idx_user_access_2_user on tbl_user_access useraccess28_ (cost=0.29..8.30 rows=1 width=37) (actual time=0.010..0.011 rows=1 loops=3)

  • Index Cond: ((user_id)::text = '58375063-937d-4694-9282-dd1b34e587ae'::text)
  • Filter: (active AND ((type)::text = 'ALL'::text))
47. 0.009 0.009 ↑ 1.0 1 3 / 3

Index Only Scan using tbl_site_pkey on tbl_site site29_ (cost=0.28..8.30 rows=1 width=37) (actual time=0.009..0.009 rows=1 loops=3)

  • Index Cond: (id = (useraccess28_.site_id)::text)
  • Heap Fetches: 0
48. 0.042 0.042 ↑ 1.0 1 3 / 3

Index Scan using idx_company_2_main_site on tbl_company company30_ (cost=0.28..0.43 rows=1 width=74) (actual time=0.041..0.042 rows=1 loops=3)

  • Index Cond: ((main_site_id)::text = (site29_.id)::text)
49. 0.109 0.109 ↓ 74.0 148 3 / 3

Index Scan using idx_site_2_company on tbl_site site31_ (cost=0.28..0.63 rows=2 width=74) (actual time=0.018..0.109 rows=148 loops=3)

  • Index Cond: ((company_id)::text = (company30_.id)::text)
50. 15.246 15.246 ↑ 1.0 1 7,623 / 3

Index Scan using tbl_site_pkey on tbl_site site1_ (cost=0.28..0.32 rows=1 width=1,224) (actual time=0.006..0.006 rows=1 loops=7,623)

  • Index Cond: ((transactio0_.supplier_site_id)::text = (id)::text)
51. 10.164 10.164 ↑ 1.0 1 7,623 / 3

Index Scan using tbl_company_pkey on tbl_company company4_ (cost=0.28..0.43 rows=1 width=1,396) (actual time=0.004..0.004 rows=1 loops=7,623)

  • Index Cond: ((site1_.company_id)::text = (id)::text)
52. 20.328 20.328 ↑ 1.0 1 7,623 / 3

Index Scan using tbl_payment_detail_application_site_id_key on tbl_payment_detail ordpayment5_ (cost=0.41..0.82 rows=1 width=1,388) (actual time=0.008..0.008 rows=1 loops=7,623)

  • Index Cond: (((application)::text = 'ORD'::text) AND ((site1_.id)::text = (site_id)::text))
53. 20.328 20.328 ↑ 1.0 1 7,623 / 3

Index Scan using tbl_payment_detail_application_site_id_key on tbl_payment_detail mrtpayment6_ (cost=0.41..0.82 rows=1 width=1,388) (actual time=0.008..0.008 rows=1 loops=7,623)

  • Index Cond: (((application)::text = 'MRT'::text) AND ((site1_.id)::text = (site_id)::text))
54. 10.164 10.164 ↓ 0.0 0 7,623 / 3

Index Scan using idx_company_2_main_site on tbl_company company9_ (cost=0.28..0.43 rows=1 width=1,396) (actual time=0.004..0.004 rows=0 loops=7,623)

  • Index Cond: ((site1_.id)::text = (main_site_id)::text)
55. 12.705 12.705 ↑ 1.0 1 7,623 / 3

Index Scan using tbl_site_pkey on tbl_site site2_ (cost=0.28..0.32 rows=1 width=1,224) (actual time=0.005..0.005 rows=1 loops=7,623)

  • Index Cond: ((transactio0_.client_site_id)::text = (id)::text)
56. 12.705 12.705 ↑ 1.0 1 7,623 / 3

Index Scan using tbl_company_pkey on tbl_company company3_ (cost=0.28..0.43 rows=1 width=1,396) (actual time=0.005..0.005 rows=1 loops=7,623)

  • Index Cond: ((site2_.company_id)::text = (id)::text)
57. 17.787 17.787 ↑ 1.0 1 7,623 / 3

Index Scan using tbl_payment_detail_application_site_id_key on tbl_payment_detail ordpayment7_ (cost=0.41..0.82 rows=1 width=1,388) (actual time=0.007..0.007 rows=1 loops=7,623)

  • Index Cond: (((application)::text = 'ORD'::text) AND ((site2_.id)::text = (site_id)::text))
58. 17.787 17.787 ↑ 1.0 1 7,623 / 3

Index Scan using tbl_payment_detail_application_site_id_key on tbl_payment_detail mrtpayment8_ (cost=0.41..0.82 rows=1 width=1,388) (actual time=0.007..0.007 rows=1 loops=7,623)

  • Index Cond: (((application)::text = 'MRT'::text) AND ((site2_.id)::text = (site_id)::text))
59. 12.705 12.705 ↑ 1.0 1 7,623 / 3

Index Scan using idx_company_2_main_site on tbl_company company10_ (cost=0.28..0.43 rows=1 width=1,396) (actual time=0.004..0.005 rows=1 loops=7,623)

  • Index Cond: ((site2_.id)::text = (main_site_id)::text)
Planning time : 8.114 ms
Execution time : 1,115.595 ms