explain.depesz.com

A tool for finding a real cause for slow queries.

Result: lLU

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 4247.801 19359.298 ↓ 1.0 1000000 1

Merge Join (cost=1311774.16..1332195.77 rows=998405 width=566) (actual time=14697.013..19359.298 rows=1000000 loops=1)

  • Merge Cond: ((tmp_ap.fs_party)::text = (tmp_di.fs_party)::text)
2. 12614.050 14176.923 ↓ 1.0 1000000 1

Sort (cost=1305391.01..1307887.03 rows=998405 width=533) (actual time=13804.476..14176.923 rows=1000000 loops=1)

  • Sort Key: tmp_ap.fs_party
  • Sort Method: external sort Disk: 306952kB
3. 582.491 1562.873 ↓ 1.0 1000000 1

Hash Join (cost=2112.40..250389.62 rows=998405 width=533) (actual time=26.381..1562.873 rows=1000000 loops=1)

  • Hash Cond: ((cm_ledgeritem.salesteam)::text = (tmp_ap.tril_gid)::text)
4. 954.031 954.031 ↓ 1.0 1000000 1

Seq Scan on cm_ledgeritem (cost=0.00..99075.12 rows=998405 width=500) (actual time=0.010..954.031 rows=1000000 loops=1)

  • Filter: (fs_batchid = 1)
5. 19.173 26.351 ↑ 1.0 45351 1

Hash (cost=1013.51..1013.51 rows=45351 width=66) (actual time=26.351..26.351 rows=45351 loops=1)

6. 7.178 7.178 ↑ 1.0 45351 1

Seq Scan on tmp_ap (cost=0.00..1013.51 rows=45351 width=66) (actual time=0.002..7.178 rows=45351 loops=1)

7. 84.354 934.574 ↓ 22.9 1038059 1

Materialize (cost=6383.15..6950.04 rows=45351 width=66) (actual time=699.326..934.574 rows=1038059 loops=1)

8. 845.338 850.220 ↑ 1.2 38060 1

Sort (cost=6383.15..6496.53 rows=45351 width=66) (actual time=699.320..850.220 rows=38060 loops=1)

  • Sort Key: tmp_di.fs_party
  • Sort Method: external merge Disk: 3344kB
9. 4.882 4.882 ↑ 1.0 45351 1

Seq Scan on tmp_di (cost=0.00..1013.51 rows=45351 width=66) (actual time=0.005..4.882 rows=45351 loops=1)