explain.depesz.com

PostgreSQL's explain analyze made readable

Result: W22n

Settings
# exclusive inclusive rows x rows loops node
1. 0.269 599.830 ↑ 1.0 1,000 1

Limit (cost=45.35..15,818.67 rows=1,000 width=1,676) (actual time=0.953..599.830 rows=1,000 loops=1)

2. 553.835 599.561 ↑ 612.1 1,000 1

Nested Loop Left Join (cost=45.35..9,648,741.36 rows=612,098 width=1,676) (actual time=0.952..599.561 rows=1,000 loops=1)

  • Join Filter: (t3.id = t.raion)
  • Rows Removed by Join Filter: 1,000
3. 1.482 45.726 ↑ 612.1 1,000 1

Nested Loop Left Join (cost=45.35..7,154,441.00 rows=612,098 width=1,058) (actual time=0.264..45.726 rows=1,000 loops=1)

4. 18.579 38.244 ↑ 612.1 1,000 1

Nested Loop Semi Join (cost=44.92..2,848,053.39 rows=612,098 width=1,015) (actual time=0.259..38.244 rows=1,000 loops=1)

  • Join Filter: (t.cid = t_1.catalog)
  • Rows Removed by Join Filter: 147,691
5. 1.755 12.665 ↑ 612.1 1,000 1

Merge Left Join (cost=2.92..1,972,408.77 rows=612,098 width=1,015) (actual time=0.030..12.665 rows=1,000 loops=1)

  • Merge Cond: (t.city = t1.id)
6. 8.269 8.269 ↑ 612.1 1,000 1

Index Scan using i_d_agent_addrs_c on d_agent_addrs t (cost=0.42..1,772,777.12 rows=612,098 width=966) (actual time=0.013..8.269 rows=1,000 loops=1)

7. 2.641 2.641 ↑ 286.4 4,235 1

Index Scan using pk_d_geografy on d_geografy t1 (cost=0.43..190,052.38 rows=1,212,991 width=49) (actual time=0.011..2.641 rows=4,235 loops=1)

8. 6.597 7.000 ↑ 1.5 149 1,000

Materialize (cost=42.00..795.53 rows=224 width=7) (actual time=0.000..0.007 rows=149 loops=1,000)

9. 0.270 0.403 ↑ 1.4 157 1

Bitmap Heap Scan on d_urprivs t_1 (cost=42.00..794.41 rows=224 width=7) (actual time=0.219..0.403 rows=157 loops=1)

  • Recheck Cond: ((unitcode)::text = 'AGENT_ADDRS'::text)
  • Filter: (((username)::text = ((USER)::character varying)::text) OR (hashed SubPlan 1))
  • Heap Blocks: exact=60
10. 0.046 0.046 ↑ 1.1 390 1

Bitmap Index Scan on i_d_urprivs_ulr (cost=0.00..15.67 rows=434 width=0) (actual time=0.045..0.046 rows=390 loops=1)

  • Index Cond: ((unitcode)::text = 'AGENT_ADDRS'::text)
11.          

SubPlan (for Bitmap Heap Scan)

12. 0.022 0.087 ↓ 54.0 216 1

Nested Loop (cost=4.60..26.26 rows=4 width=6) (actual time=0.041..0.087 rows=216 loops=1)

13. 0.012 0.012 ↑ 1.0 1 1

Index Scan using uk_d_users on d_users us (cost=0.29..8.30 rows=1 width=7) (actual time=0.011..0.012 rows=1 loops=1)

  • Index Cond: ((username)::text = ((USER)::character varying(30))::text)
14. 0.029 0.053 ↓ 54.0 216 1

Bitmap Heap Scan on d_userroles ur (cost=4.32..17.92 rows=4 width=13) (actual time=0.027..0.053 rows=216 loops=1)

  • Recheck Cond: (sysuser = us.id)
  • Heap Blocks: exact=5
15. 0.024 0.024 ↓ 54.0 216 1

Bitmap Index Scan on i_d_userroles_u (cost=0.00..4.32 rows=4 width=0) (actual time=0.024..0.024 rows=216 loops=1)

  • Index Cond: (sysuser = us.id)
16. 6.000 6.000 ↑ 1.0 1 1,000

Index Scan using pk_d_geografy on d_geografy t2 (cost=0.43..7.04 rows=1 width=49) (actual time=0.006..0.006 rows=1 loops=1,000)

  • Index Cond: (id = t.street)
17. 0.000 0.000 ↑ 1.0 1 1,000

Materialize (cost=0.00..1.01 rows=1 width=252) (actual time=0.000..0.000 rows=1 loops=1,000)

18. 0.005 0.005 ↑ 1.0 1 1

Seq Scan on d_raions t3 (cost=0.00..1.01 rows=1 width=252) (actual time=0.005..0.005 rows=1 loops=1)

Planning time : 6.405 ms
Execution time : 600.216 ms