explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1XX

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 0.727 ↓ 0.0 0 1

Limit (cost=357,364.18..357,364.19 rows=5 width=220) (actual time=0.727..0.727 rows=0 loops=1)

  • Buffers: shared read=78
2.          

CTE lotscte

3. 0.000 0.000 ↓ 0.0 0

Gather (cost=5,430.41..20,503.38 rows=8,736 width=36) (never executed)

  • Workers Planned: 2
  • Workers Launched: 0
4. 0.000 0.000 ↓ 0.0 0

Parallel Append (cost=4,430.41..18,629.78 rows=3,640 width=36) (never executed)

5. 0.000 0.000 ↓ 0.0 0

Subquery Scan on *SELECT* 1 (cost=18,357.21..18,611.58 rows=8,479 width=36) (never executed)

6. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=18,357.21..18,526.79 rows=8,479 width=43) (never executed)

  • Group Key: oc.orderid, oc.maxprice
7. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on v_order44contractsuppliers oc (cost=274.96..18,292.95 rows=8,568 width=18) (never executed)

  • Recheck Cond: (supplierid = 938,005)
8. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ix_v_order44contractsuppliers (cost=0.00..272.81 rows=8,568 width=0) (never executed)

  • Index Cond: (supplierid = 938,005)
9. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=4,430.41..4,432.91 rows=200 width=36) (never executed)

  • Group Key: olc.orderid
10. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=4,373.08..4,405.84 rows=1,638 width=47) (never executed)

  • Group Key: olc.orderid, olc.lotid, olc.maxprice
11. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on v_order44lotcontractsuppliers olc (cost=57.20..4,356.60 rows=1,648 width=22) (never executed)

  • Recheck Cond: (supplierid = 938,005)
12. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ix_v_order44lotcontractsuppliers (cost=0.00..56.79 rows=1,648 width=0) (never executed)

  • Index Cond: (supplierid = 938,005)
13. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=227.51..228.22 rows=57 width=36) (never executed)

  • Group Key: olp.orderid
14. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=225.52..226.66 rows=57 width=47) (never executed)

  • Group Key: olp.orderid, olp.lotid, olp.maxprice
15. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on v_order223lotpactsuppliers olp (cost=5.00..224.95 rows=57 width=22) (never executed)

  • Recheck Cond: (supplierid = 938,005)
16. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ix_v_order223lotpactsuppliers (cost=0.00..4.98 rows=57 width=0) (never executed)

  • Index Cond: (supplierid = 938,005)
17.          

CTE participantscte

18. 0.000 0.000 ↓ 0.0 0

Finalize GroupAggregate (cost=270,524.10..317,370.75 rows=387,897 width=20) (never executed)

  • Group Key: p.orderid
19. 0.000 0.000 ↓ 0.0 0

Gather Merge (cost=270,524.10..311,067.42 rows=323,248 width=20) (never executed)

  • Workers Planned: 2
  • Workers Launched: 0
20. 0.000 0.000 ↓ 0.0 0

Partial GroupAggregate (cost=269,524.08..272,756.56 rows=161,624 width=20) (never executed)

  • Group Key: p.orderid
21. 0.000 0.000 ↓ 0.0 0

Sort (cost=269,524.08..269,928.14 rows=161,624 width=5) (never executed)

  • Sort Key: p.orderid
22. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=528.79..253,329.76 rows=161,624 width=5) (never executed)

23. 0.000 0.000 ↓ 0.0 0

Parallel Bitmap Heap Scan on v_dn_orderssuppliers dnos (cost=528.36..43,619.84 rows=6,441 width=4) (never executed)

  • Recheck Cond: (supplierid = 938,005)
24. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ix_v_dn_orderssuppliers_all (cost=0.00..524.49 rows=15,458 width=0) (never executed)

  • Index Cond: (supplierid = 938,005)
25. 0.000 0.000 ↓ 0.0 0

Index Only Scan using ix_tenderparticipants_orderid on tenderparticipants p (cost=0.43..32.31 rows=25 width=5) (never executed)

  • Index Cond: (orderid = dnos.orderid)
  • Heap Fetches: 0
26.          

CTE preselect

27. 0.001 0.717 ↓ 0.0 0 1

GroupAggregate (cost=11,820.82..11,869.13 rows=1,017 width=148) (actual time=0.717..0.717 rows=0 loops=1)

  • Group Key: dnoc.customerid
  • Buffers: shared read=78
28. 0.003 0.716 ↓ 0.0 0 1

Sort (cost=11,820.82..11,823.37 rows=1,017 width=67) (actual time=0.716..0.716 rows=0 loops=1)

  • Sort Key: dnoc.customerid
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared read=78
29. 0.000 0.713 ↓ 0.0 0 1

Nested Loop (cost=1,926.60..11,770.02 rows=1,017 width=67) (actual time=0.713..0.713 rows=0 loops=1)

  • Join Filter: (dnos_1.orderid = dnoc.orderid)
  • Buffers: shared read=78
30. 0.008 0.713 ↓ 0.0 0 1

Hash Right Join (cost=1,926.17..11,138.73 rows=60 width=71) (actual time=0.713..0.713 rows=0 loops=1)

  • Hash Cond: (p_1.orderid = o.id)
  • Buffers: shared read=78
31. 0.000 0.000 ↓ 0.0 0

CTE Scan on participantscte p_1 (cost=0.00..7,757.94 rows=387,897 width=20) (never executed)

32. 0.000 0.705 ↓ 0.0 0 1

Hash (cost=1,925.42..1,925.42 rows=60 width=55) (actual time=0.705..0.705 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
  • Buffers: shared read=78
33. 0.007 0.705 ↓ 0.0 0 1

Hash Right Join (cost=1,717.93..1,925.42 rows=60 width=55) (actual time=0.705..0.705 rows=0 loops=1)

  • Hash Cond: (l.orderid = o.id)
  • Buffers: shared read=78
34. 0.000 0.000 ↓ 0.0 0

CTE Scan on lotscte l (cost=0.00..174.72 rows=8,736 width=36) (never executed)

35. 0.000 0.698 ↓ 0.0 0 1

Hash (cost=1,717.18..1,717.18 rows=60 width=23) (actual time=0.698..0.698 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
  • Buffers: shared read=78
36. 0.001 0.698 ↓ 0.0 0 1

Nested Loop (cost=176.44..1,717.18 rows=60 width=23) (actual time=0.698..0.698 rows=0 loops=1)

  • Buffers: shared read=78
37. 0.697 0.697 ↓ 0.0 0 1

Index Scan using ix_v_dn_orderssuppliers_all on v_dn_orderssuppliers dnos_1 (cost=176.00..1,413.88 rows=60 width=19) (actual time=0.697..0.697 rows=0 loops=1)

  • Index Cond: ((supplierid = 938,005) AND (publishdate >= '2018-08-08 00:00:00'::timestamp without time zone) AND (publishdate <= '2019-08-08 00:00:00'::timestamp without time zone))
  • Filter: ((NOT (hashed SubPlan 3)) AND (lawid = ANY ('{1,2,3,4,5,6,7,8,9}'::integer[])))
  • Buffers: shared read=78
38.          

SubPlan (for Index Scan)

39. 0.000 0.000 ↓ 0.0 0

Seq Scan on tendertypes (cost=0.00..174.57 rows=347 width=2) (never executed)

  • Filter: ((name)::text ~~* '%единствен%'::text)
40. 0.000 0.000 ↓ 0.0 0

Index Only Scan using "PK_ORDERS" on orders o (cost=0.44..5.05 rows=1 width=4) (never executed)

  • Index Cond: (id = dnos_1.orderid)
  • Heap Fetches: 0
41. 0.000 0.000 ↓ 0.0 0

Index Scan using ix_dn_orderscustomers_orderid on dn_orderscustomers dnoc (cost=0.44..10.31 rows=17 width=8) (never executed)

  • Index Cond: (orderid = o.id)
42.          

Initplan (for Limit)

43. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=22.89..22.90 rows=1 width=32) (never executed)

44. 0.000 0.000 ↓ 0.0 0

CTE Scan on preselect preselect_1 (cost=0.00..20.34 rows=1,017 width=32) (never executed)

45. 0.004 0.726 ↓ 0.0 0 1

Sort (cost=7,598.02..7,600.56 rows=1,017 width=220) (actual time=0.726..0.726 rows=0 loops=1)

  • Sort Key: preselect.suppliercontractprice DESC, preselect.w DESC NULLS LAST
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared read=78
46. 0.002 0.722 ↓ 0.0 0 1

WindowAgg (cost=7,550.62..7,581.13 rows=1,017 width=220) (actual time=0.722..0.722 rows=0 loops=1)

  • Buffers: shared read=78
47. 0.002 0.720 ↓ 0.0 0 1

Sort (cost=7,550.62..7,553.16 rows=1,017 width=406) (actual time=0.720..0.720 rows=0 loops=1)

  • Sort Key: preselect.suppliercontractprice DESC, preselect.w DESC
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared read=78
48. 0.000 0.718 ↓ 0.0 0 1

Nested Loop (cost=0.42..7,499.82 rows=1,017 width=406) (actual time=0.718..0.718 rows=0 loops=1)

  • Buffers: shared read=78
49. 0.718 0.718 ↓ 0.0 0 1

CTE Scan on preselect (cost=0.00..20.34 rows=1,017 width=148) (actual time=0.717..0.718 rows=0 loops=1)

  • Buffers: shared read=78
50. 0.000 0.000 ↓ 0.0 0

Index Scan using "PK_CUSTOMERS" on customers c (cost=0.42..7.35 rows=1 width=262) (never executed)

  • Index Cond: (id = preselect.customerid)
Planning time : 95.174 ms
Execution time : 1.147 ms