explain.depesz.com

PostgreSQL's explain analyze made readable

Result: T6my

Settings
# exclusive inclusive rows x rows loops node
1. 0.032 7,304.041 ↑ 1.0 200 1

Limit (cost=324,392.08..324,444.08 rows=200 width=1,131) (actual time=7,303.636..7,304.041 rows=200 loops=1)

  • Buffers: shared hit=95852, temp read=9342 written=17394
2. 0.237 7,304.009 ↑ 1,335.9 200 1

Unique (cost=324,392.08..393,857.32 rows=267,174 width=1,131) (actual time=7,303.634..7,304.009 rows=200 loops=1)

  • Buffers: shared hit=95852, temp read=9342 written=17394
3. 4,014.154 7,303.772 ↑ 1,335.9 200 1

Sort (cost=324,392.08..325,060.02 rows=267,174 width=1,131) (actual time=7,303.632..7,303.772 rows=200 loops=1)

  • Sort Key: contragent_supplier.name, contragent_supplier.id, (concat(contragent_corporation.short_name, contragent_person.fname)), (concat(contragent_corporation.full_name, contragent_person.entrepreneur_full_name)), contragent_supplier.version, contragent_supplier.state, contragent_supplier.begin, contragent_supplier."end", contragent_supplier.created, contragent_supplier.modified, contragent_supplier.external_id, contragent_supplier.ent_id, contragent_supplier.direct_id, contragent_supplier.group_id, contragent_supplier.supplier_type, contragent_supplier.person_id, contragent_supplier.corporation_id, contragent_supplier.uuid, contragent_supplier.country_id, contragent_person.id, contragent_person.fname, contragent_person.iname, contragent_person.oname, contragent_person.g_fname, contragent_person.g_iname, contragent_person.g_oname, contragent_person.d_fname, contragent_person.d_iname, contragent_person.d_oname, contragent_person.inn, contragent_person.snils, contragent_person.phone, contragent_person.email, contragent_person.person_type, contragent_person.dul_type_id, contragent_person.dul_seria, contragent_person.dul_number, contragent_person.dul_issue_date, contragent_person.dul_issue_by, contragent_person.address_id, contragent_person.is_entrepreneur, contragent_person.entrepreneur_okved, contragent_person.entrepreneur_ogrn, contragent_person.entrepreneur_okpo, contragent_person.entrepreneur_okato, contragent_person.entrepreneur_oktmo, contragent_person.entrepreneur_phone, contragent_person.entrepreneur_full_name, contragent_person.entrepreneur_ur_address_id, contragent_person.entrepreneur_fact_address_id, contragent_person.entrepreneur_mail_address_id, contragent_address.id, contragent_address.address_type, contragent_address.geo, contragent_address.street, contragent_address.house, contragent_address.building, contragent_address.structure, contragent_address.flat, contragent_address.address, contragent_address.office, contragent_address.kladr_geo, contragent_address.kladr_street, contragent_address.kladr_house, contragent_address.kladr_building, contragent_address.kladr_flat, contragent_address.kladr_address, contragent_address.kladr_office, contragent_corporation.id, contragent_corporation.short_name, contragent_corporation.full_name, contragent_corporation.inn, contragent_corporation.kpp, contragent_corporation.filial, contragent_corporation.phone, contragent_corporation.email, contragent_corporation.ent_type, contragent_corporation.okved, contragent_corporation.ogrn, contragent_corporation.okpo, contragent_corporation.okato, contragent_corporation.oktmo, contragent_corporation.ur_address_id, contragent_corporation.fact_address_id, contragent_corporation.mail_address_id, contragent_corporation.budget_item, t5.id, t5.address_type, t5.geo, t5.street, t5.house, t5.building, t5.structure, t5.flat, t5.address, t5.office, t5.kladr_geo, t5.kladr_street, t5.kladr_house, t5.kladr_building, t5.kladr_flat, t5.kladr_address, t5.kladr_office
  • Sort Method: external merge Disk: 139136kB
  • Buffers: shared hit=95852, temp read=9342 written=17394
4. 293.320 3,289.618 ↓ 1.0 267,558 1

Hash Join (cost=113,708.12..167,894.29 rows=267,174 width=1,131) (actual time=1,980.801..3,289.618 rows=267,558 loops=1)

  • Buffers: shared hit=95852
5. 95.487 2,456.402 ↓ 1.0 267,558 1

Hash Join (cost=88,645.72..139,158.51 rows=267,174 width=824) (actual time=1,437.748..2,456.402 rows=267,558 loops=1)

  • Buffers: shared hit=82697
6. 146.367 1,793.045 ↓ 1.0 267,558 1

Hash Join (cost=63,583.31..112,945.75 rows=267,174 width=581) (actual time=866.004..1,793.045 rows=267,558 loops=1)

  • Buffers: shared hit=69542
7. 592.195 1,182.067 ↓ 1.0 267,558 1

Hash Join (cost=46,230.42..94,248.43 rows=267,174 width=402) (actual time=399.103..1,182.067 rows=267,558 loops=1)

  • Buffers: shared hit=60921
8. 192.421 192.421 ↑ 1.0 1,140,723 1

Seq Scan on contragent_corporation contragent_corporation (cost=0..41,410.85 rows=1,140,785 width=239) (actual time=0.015..192.421 rows=1,140,723 loops=1)

  • Buffers: shared hit=30003
9. 159.146 397.451 ↓ 1.0 267,558 1

Hash (cost=42,890.75..42,890.75 rows=267,174 width=163) (actual time=397.451..397.451 rows=267,558 loops=1)

  • Buffers: shared hit=30918
10. 207.604 238.305 ↓ 1.0 267,558 1

Bitmap Heap Scan on contragent_supplier contragent_supplier (cost=7,107.83..42,890.75 rows=267,174 width=163) (actual time=40.316..238.305 rows=267,558 loops=1)

  • Filter: ((contragent_supplier."end" >= '2019-08-05'::date) OR (contragent_supplier."end" IS NULL))
  • Buffers: shared hit=30918
11. 30.701 30.701 ↓ 1.0 267,558 1

Bitmap Index Scan on contragent_supplier_ent_id_6b220edd5d346340 (cost=0..7,041.04 rows=267,261 width=0) (actual time=30.701..30.701 rows=267,558 loops=1)

  • Index Cond: ((contragent_supplier.ent_id IS NULL) AND (contragent_supplier.begin <= '2019-08-05'::date))
  • Buffers: shared hit=1321
12. 279.715 464.611 ↓ 1.0 388,102 1

Hash (cost=12,501.84..12,501.84 rows=388,084 width=179) (actual time=464.611..464.611 rows=388,102 loops=1)

  • Buffers: shared hit=8621
13. 184.896 184.896 ↓ 1.0 388,102 1

Seq Scan on contragent_person contragent_person (cost=0..12,501.84 rows=388,084 width=179) (actual time=0.022..184.896 rows=388,102 loops=1)

  • Buffers: shared hit=8621
14. 358.420 567.870 ↓ 1.0 529,224 1

Hash (cost=18,447.18..18,447.18 rows=529,218 width=243) (actual time=567.869..567.87 rows=529,224 loops=1)

  • Buffers: shared hit=13155
15. 209.450 209.450 ↓ 1.0 529,224 1

Seq Scan on contragent_address contragent_address (cost=0..18,447.18 rows=529,218 width=243) (actual time=0.017..209.45 rows=529,224 loops=1)

  • Buffers: shared hit=13155
16. 343.300 539.896 ↓ 1.0 529,224 1

Hash (cost=18,447.18..18,447.18 rows=529,218 width=243) (actual time=539.896..539.896 rows=529,224 loops=1)

  • Buffers: shared hit=13155
17. 196.596 196.596 ↓ 1.0 529,224 1

Seq Scan on contragent_address t5 (cost=0..18,447.18 rows=529,218 width=243) (actual time=0.03..196.596 rows=529,224 loops=1)

  • Buffers: shared hit=13155