explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ifWu

Settings
# exclusive inclusive rows x rows loops node
1. 1,234.545 128,196.147 ↑ 1,069.2 21 1

Seq Scan on slrkadr t (cost=2.51..932,246.55 rows=22,453 width=5,427) (actual time=2,910.639..128,196.147 rows=21 loops=1)

  • Filter: ($0 AND ((alternatives: SubPlan 7 or hashed SubPlan 13) OR ((lworker)::text = 'N'::text)) AND (instr((upper((snm)::text))::character varying, 'УВАРОВ'::character varying) <> 0))
  • Rows Removed by Filter: 87599
2.          

Initplan (for Seq Scan)

3. 0.222 0.222 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.222..0.222 rows=1 loops=1)

4.          

SubPlan (for Seq Scan)

5. 4,516.413 126,961.380 ↑ 1.0 1 87,620

Index Scan using fk_slrcard_kadr on slrcard (cost=2.93..9.27 rows=1 width=0) (actual time=1.449..1.449 rows=1 loops=87,620)

  • Index Cond: (idkadr = t.id)
  • Filter: ($2 AND (alternatives: SubPlan 4 or hashed SubPlan 6))
  • Rows Removed by Filter: 0
6.          

Initplan (for Index Scan)

7. 0.112 0.112 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.112..0.112 rows=1 loops=1)

8.          

SubPlan (for Index Scan)

9. 122,444.745 122,444.855 ↑ 4.0 1 91,445

Index Scan using fk_slrmovement_card on slrmovement (cost=2.93..7.67 rows=4 width=0) (actual time=1.339..1.339 rows=1 loops=91,445)

  • Index Cond: ((idcard = slrcard.id) AND (idcard = slrcard.id))
  • Filter: ($4 AND ((iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric))) OR (iddepartment IS NULL)))
  • Rows Removed by Filter: 1
10.          

Initplan (for Index Scan)

11. 0.110 0.110 ↑ 1.0 1 1

Result (cost=0.00..2.51 rows=1 width=1) (actual time=0.110..0.110 rows=1 loops=1)

12. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on slrmovement slrmovement_1 (cost=3,542.12..922,393.42 rows=178,500 width=9) (never executed)

  • Recheck Cond: ((iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric))) OR (iddepartment IS NULL))
  • Filter: $6
13.          

Initplan (for Bitmap Heap Scan)

14. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..2.51 rows=1 width=1) (never executed)

15. 0.000 0.000 ↓ 0.0 0

BitmapOr (cost=3,539.61..3,539.61 rows=357,012 width=0) (never executed)

16. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on fk_slrmovement_department (cost=0.00..3,448.73 rows=356,998 width=0) (never executed)

  • Index Cond: (iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric)))
17. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on fk_slrmovement_department (cost=0.00..1.63 rows=14 width=0) (never executed)

  • Index Cond: (iddepartment IS NULL)
18. 0.000 0.000 ↓ 0.0 0

Seq Scan on slrcard slrcard_1 (cost=2.51..399,391.74 rows=23,915 width=8) (never executed)

  • Filter: ($8 AND (alternatives: SubPlan 10 or hashed SubPlan 12))
19.          

Initplan (for Seq Scan)

20. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..2.51 rows=1 width=1) (never executed)

21.          

SubPlan (for Seq Scan)

22. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_slrmovement_card on slrmovement slrmovement_2 (cost=2.93..7.67 rows=4 width=0) (never executed)

  • Index Cond: ((idcard = slrcard_1.id) AND (idcard = slrcard_1.id))
  • Filter: ($10 AND ((iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric))) OR (iddepartment IS NULL)))
23.          

Initplan (for Index Scan)

24. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..2.51 rows=1 width=1) (never executed)

25. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on slrmovement slrmovement_3 (cost=3,542.12..922,393.42 rows=178,500 width=9) (never executed)

  • Recheck Cond: ((iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric))) OR (iddepartment IS NULL))
  • Filter: $12
26.          

Initplan (for Bitmap Heap Scan)

27. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..2.51 rows=1 width=1) (never executed)

28. 0.000 0.000 ↓ 0.0 0

BitmapOr (cost=3,539.61..3,539.61 rows=357,012 width=0) (never executed)

29. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on fk_slrmovement_department (cost=0.00..3,448.73 rows=356,998 width=0) (never executed)

  • Index Cond: (iddepartment = ANY (adm_pfuncafi.gettblaccessforattr_in(SESSION_USER, 'slrmovement'::name, '842001'::numeric)))
30. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on fk_slrmovement_department (cost=0.00..1.63 rows=14 width=0) (never executed)

  • Index Cond: (iddepartment IS NULL)
Planning time : 350.465 ms
Execution time : 128,196.663 ms