explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 16eN

Settings
# exclusive inclusive rows x rows loops node
1. 0.027 368,766.437 ↓ 4.7 200 1

Limit (cost=592,488.94..592,489.04 rows=43 width=19) (actual time=368,766.396..368,766.437 rows=200 loops=1)

2. 161.508 368,766.410 ↓ 4.7 200 1

Sort (cost=592,488.94..592,489.04 rows=43 width=19) (actual time=368,766.394..368,766.410 rows=200 loops=1)

  • Sort Key: document_base.number_value, document_base.number, document_pay_doc_out.basedocumentmodel_ptr_id
  • Sort Method: top-N heapsort Memory: 46kB
3. 208.611 368,604.902 ↓ 1,180.4 50,759 1

Nested Loop (cost=7,488.06..592,487.77 rows=43 width=19) (actual time=2.443..368,604.902 rows=50,759 loops=1)

4. 235.556 367,787.183 ↓ 1,180.4 50,759 1

Nested Loop (cost=7,487.78..592,473.32 rows=43 width=27) (actual time=2.431..367,787.183 rows=50,759 loops=1)

5. 233.817 228,878.039 ↓ 433.8 50,759 1

Hash Join (cost=7,487.34..592,008.16 rows=117 width=27) (actual time=2.418..228,878.039 rows=50,759 loops=1)

  • Hash Cond: (document_base.type_id = document_types.id)
6. 228,641.893 228,641.893 ↑ 1.8 87,340 1

Index Scan using document_ba_ent_id_d11d50_idx on document_base (cost=0.56..584,100.16 rows=160,464 width=47) (actual time=0.046..228,641.893 rows=87,340 loops=1)

  • Index Cond: ((ent_id = ANY ('{837,838,903,847,906,910,913,1636,916,843,845,851,857,858,860,862,863,865,866,867,869,870,871,872,873,874,875,878,879,880,882,883,884,885,887,888,890,891,892,893,894,895,896,899,900,901,904,905,1 (...)
  • Filter: (state <> 4)
7. 0.214 2.329 ↓ 1.0 1,886 1

Hash (cost=7,463.44..7,463.44 rows=1,867 width=4) (actual time=2.328..2.329 rows=1,886 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 83kB
8. 1.081 2.115 ↓ 1.0 1,886 1

Bitmap Heap Scan on document_types (cost=687.52..7,463.44 rows=1,867 width=4) (actual time=1.077..2.115 rows=1,886 loops=1)

  • Recheck Cond: ((ent_id = ANY ('{837,838,903,847,906,910,913,1636,916,843,845,851,857,858,860,862,863,865,866,867,869,870,871,872,873,874,875,878,879,880,882,883,884,885,887,888,890,891,892,893,894,895,896,899,900,901,9 (...)
  • Heap Blocks: exact=416
9. 1.034 1.034 ↓ 1.0 1,886 1

Bitmap Index Scan on document_types_ent_id_7f9fb2f26c3ba828 (cost=0.00..687.05 rows=1,867 width=0) (actual time=1.034..1.034 rows=1,886 loops=1)

  • Index Cond: ((ent_id = ANY ('{837,838,903,847,906,910,913,1636,916,843,845,851,857,858,860,862,863,865,866,867,869,870,871,872,873,874,875,878,879,880,882,883,884,885,887,888,890,891,892,893,894,895,896,899,900,9 (...)
10. 138,673.588 138,673.588 ↑ 1.0 1 50,759

Index Scan using document_pa_basedoc_f82edc_idx on document_pay_doc_out (cost=0.43..3.98 rows=1 width=16) (actual time=2.732..2.732 rows=1 loops=50,759)

  • Index Cond: (basedocumentmodel_ptr_id = document_base.id)
11. 609.108 609.108 ↑ 1.0 1 50,759

Index Only Scan using enterprise_pkey on enterprise (cost=0.29..0.34 rows=1 width=4) (actual time=0.012..0.012 rows=1 loops=50,759)

  • Index Cond: (id = document_base.ent_id)
  • Heap Fetches: 50759
Planning time : 1.970 ms
Execution time : 368,766.583 ms