explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sZc5

Settings
# exclusive inclusive rows x rows loops node
1. 0.042 185,968.811 ↑ 1.0 25 1

Limit (cost=1,003.81..36,967.70 rows=25 width=516) (actual time=185,843.960..185,968.811 rows=25 loops=1)

2. 80.935 185,968.769 ↑ 8,869.4 25 1

Gather Merge (cost=1,003.81..318,979,150.08 rows=221,735 width=516) (actual time=185,843.952..185,968.769 rows=25 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.095 185,887.834 ↑ 5,434.7 17 3 / 3

Nested Loop Left Join (cost=3.79..318,952,556.33 rows=92,390 width=516) (actual time=185,828.854..185,887.834 rows=17 loops=3)

4. 0.070 185,887.618 ↑ 5,434.7 17 3 / 3

Nested Loop Left Join (cost=3.51..318,756,920.50 rows=92,390 width=879) (actual time=185,828.772..185,887.618 rows=17 loops=3)

5. 0.079 185,887.427 ↑ 5,434.7 17 3 / 3

Nested Loop Left Join (cost=3.23..318,546,062.32 rows=92,390 width=783) (actual time=185,828.712..185,887.427 rows=17 loops=3)

6. 0.082 185,885.840 ↑ 5,434.7 17 3 / 3

Nested Loop Left Join (cost=2.95..318,334,830.66 rows=92,390 width=669) (actual time=185,827.857..185,885.840 rows=17 loops=3)

7. 0.086 185,883.227 ↑ 5,434.7 17 3 / 3

Nested Loop Left Join (cost=2.68..318,139,194.83 rows=92,390 width=485) (actual time=185,825.695..185,883.227 rows=17 loops=3)

8. 0.102 185,880.836 ↑ 5,434.7 17 3 / 3

Nested Loop Left Join (cost=2.40..317,928,336.65 rows=92,390 width=389) (actual time=185,823.906..185,880.836 rows=17 loops=3)

9. 0.088 185,877.787 ↑ 5,434.7 17 3 / 3

Nested Loop Left Join (cost=2.12..317,717,104.99 rows=92,390 width=275) (actual time=185,821.899..185,877.787 rows=17 loops=3)

10. 0.093 185,846.291 ↑ 5,434.7 17 3 / 3

Nested Loop Left Join (cost=1.55..317,472,677.71 rows=92,390 width=244) (actual time=185,820.123..185,846.291 rows=17 loops=3)

11. 6.268 185,830.390 ↑ 5,434.7 17 3 / 3

Nested Loop (cost=0.99..317,228,250.44 rows=92,390 width=220) (actual time=185,812.864..185,830.390 rows=17 loops=3)

12. 185,802.318 185,802.318 ↑ 1,637.4 10,902 3 / 3

Parallel Index Scan using xxtx_nm_accounting_v_id_idx on xxtx_nm_accounting_v a (cost=0.57..272,671,469.13 rows=17,850,775 width=168) (actual time=185,758.300..185,802.318 rows=10,902 loops=3)

  • Filter: ((first_rev <= 25,770) AND (last_rev > 25770) AND ((segment2)::text !~~ '911071%'::text) AND ((segment2)::text !~~ '911072%'::text) AND ((segment2)::text !~~ '911073%'::text) AND ((segment2)::text !~~ '911074%'::text) AND ((segment2)::text !~~ '911077%'::text) AND ((segment2)::text !~~ '912071%'::text) AND ((segment2)::text !~~ '912072%'::text) AND ((segment2)::text !~~ '912073%'::text) AND ((segment2)::text !~~ '912074%'::text) AND ((segment2)::text !~~ '912077%'::text) AND ((corr_segment2)::text !~~ '911071%'::text) AND ((corr_segment2)::text !~~ '911072%'::text) AND ((corr_segment2)::text !~~ '911073%'::text) AND ((corr_segment2)::text !~~ '911074%'::text) AND ((corr_segment2)::text !~~ '911077%'::text) AND ((corr_segment2)::text !~~ '912071%'::text) AND ((corr_segment2)::text !~~ '912072%'::text) AND ((corr_segment2)::text !~~ '912073%'::text) AND ((corr_segment2)::text !~~ '912074%'::text) AND ((corr_segment2)::text !~~ '912077%'::text) AND ((period)::text = ANY ('{"январь 2020","февраль 2020","март 2020"}'::text[])) AND ((filial)::text = ANY ('{01XXX,013XX,017XX,011XX,01000,01001,01004,015XX,012XX,016XX,014XX,01002,01200,01212,01113,01605,01002,01500,01606,01106,01700,01409,01205,01508,01701,01211,01313,01411,01302,01114,01003,01116,01400,01603,01405,01502,01501,01303,01308,01504,01102,01112,01706,01408,01307,01505,01403,01611,01607,01311,01402,01410,01111,01004,01300,01001,01705,01412,01101,01215,01507,01312,01204,01201,01704,01100,01404,01306,01304,01610,01000,01203,01309,01107,01703,01108,01109,01110,01702,01407,01310,01115,01608,01105,01600,01609,01708,01104,01305,01202}'::text[])))
  • Rows Removed by Filter: 65,319,559
13. 21.804 21.804 ↓ 0.0 0 32,706 / 3

Index Scan using ix_parties_party_id on xxtx_nm_parties_v p (cost=0.42..2.49 rows=1 width=65) (actual time=0.002..0.002 rows=0 loops=32,706)

  • Index Cond: (party_id = a.party_id)
  • Filter: ((inn)::text ~~ '77%'::text)
  • Rows Removed by Filter: 0
14. 15.808 15.808 ↑ 1.0 1 52 / 3

Index Scan using ix_documents_doc_type_doc_id on xxtx_nm_documents_v d (cost=0.56..2.64 rows=1 width=44) (actual time=0.911..0.912 rows=1 loops=52)

  • Index Cond: (((doc_type)::text = (a.doc_type)::text) AND (doc_id = a.doc_id))
  • Filter: ((first_rev <= 2,673,823) AND (last_rev > 2673823))
15. 31.408 31.408 ↑ 1.0 1 52 / 3

Index Scan using ix_documents_doc_type_doc_id on xxtx_nm_documents_v c (cost=0.56..2.64 rows=1 width=38) (actual time=1.811..1.812 rows=1 loops=52)

  • Index Cond: (((doc_type)::text = 'XXCN009_DOC_HEADERS'::text) AND (doc_id = a.contract_id))
  • Filter: ((first_rev <= 2,673,823) AND (last_rev > 2673823))
16. 2.947 2.947 ↑ 1.0 1 52 / 3

Index Scan using xxtx_nm_spr_s02_accounts_v_s_code_idx on xxtx_nm_spr_s02_accounts_v sa (cost=0.28..2.28 rows=1 width=125) (actual time=0.170..0.170 rows=1 loops=52)

  • Index Cond: ((s_code)::text = (a.segment2)::text)
17. 2.305 2.305 ↑ 1.0 1 52 / 3

Index Scan using xxtx_nm_spr_s03_items_v_s_code_idx on xxtx_nm_spr_s03_items_v si (cost=0.28..2.27 rows=1 width=104) (actual time=0.133..0.133 rows=1 loops=52)

  • Index Cond: ((s_code)::text = (a.segment3)::text)
18. 2.531 2.531 ↑ 1.0 1 52 / 3

Index Scan using xxtx_nm_spr_s04_tax_v_s_code_idx on xxtx_nm_spr_s04_tax_v st (cost=0.28..2.11 rows=1 width=190) (actual time=0.146..0.146 rows=1 loops=52)

  • Index Cond: ((s_code)::text = (a.segment4)::text)
19. 1.508 1.508 ↑ 1.0 1 52 / 3

Index Scan using xxtx_nm_spr_s02_accounts_v_s_code_idx on xxtx_nm_spr_s02_accounts_v csa (cost=0.28..2.28 rows=1 width=125) (actual time=0.087..0.087 rows=1 loops=52)

  • Index Cond: ((s_code)::text = (a.corr_segment2)::text)
20. 0.121 0.121 ↑ 1.0 1 52 / 3

Index Scan using xxtx_nm_spr_s03_items_v_s_code_idx on xxtx_nm_spr_s03_items_v csi (cost=0.28..2.27 rows=1 width=104) (actual time=0.007..0.007 rows=1 loops=52)

  • Index Cond: ((s_code)::text = (a.corr_segment3)::text)
21. 0.121 0.121 ↑ 1.0 1 52 / 3

Index Scan using xxtx_nm_spr_s04_tax_v_s_code_idx on xxtx_nm_spr_s04_tax_v cst (cost=0.28..2.11 rows=1 width=190) (actual time=0.007..0.007 rows=1 loops=52)

  • Index Cond: ((s_code)::text = (a.corr_segment4)::text)
Planning time : 31.575 ms
Execution time : 185,969.704 ms