explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KjRn

Settings
# exclusive inclusive rows x rows loops node
1. 1.982 27,064.103 ↑ 1.0 1,000 1

Limit (cost=208,715.15..208,742.65 rows=1,000 width=84) (actual time=27,056.101..27,064.103 rows=1,000 loops=1)

2. 3.854 27,062.121 ↑ 479.7 1,000 1

Unique (cost=208,715.15..221,906.90 rows=479,700 width=84) (actual time=27,056.093..27,062.121 rows=1,000 loops=1)

3. 2,599.244 27,058.267 ↑ 289.5 1,657 1

Sort (cost=208,715.15..209,914.40 rows=479,700 width=84) (actual time=27,056.085..27,058.267 rows=1,657 loops=1)

  • Sort Key: f.id DESC, f.data_creada, f.serie, f.interessat_principal_nom, f.tipus_factura_4d, f.referencia_centre_expedient, f.honoraris_total, f.saldo_liquidacio, f.saldo_client, f.tipus
  • Sort Method: external merge Disk: 47,560kB
4. 1,898.154 24,459.023 ↓ 1.0 482,496 1

Hash Join (cost=105,873.54..140,494.70 rows=479,700 width=84) (actual time=9,997.068..24,459.023 rows=482,496 loops=1)

  • Hash Cond: (p.empresa_id = em.id)
5. 1,988.016 22,559.982 ↓ 1.0 482,496 1

Hash Join (cost=105,871.11..138,952.19 rows=479,700 width=88) (actual time=9,996.132..22,559.982 rows=482,496 loops=1)

  • Hash Cond: (ex.oficina_id = o.id)
6. 1,924.301 20,521.985 ↓ 1.0 482,496 1

Hash Join (cost=105,526.64..137,347.96 rows=479,700 width=92) (actual time=9,945.755..20,521.985 rows=482,496 loops=1)

  • Hash Cond: (ex.project_id = p.id)
7. 2,179.209 18,592.140 ↓ 1.0 482,496 1

Hash Join (cost=105,469.19..136,022.99 rows=479,700 width=92) (actual time=9,940.131..18,592.140 rows=482,496 loops=1)

  • Hash Cond: (d.expedient_id = ex.id)
8. 2,223.433 14,963.856 ↓ 1.0 482,496 1

Hash Join (cost=85,507.31..114,801.87 rows=479,700 width=88) (actual time=8,481.555..14,963.856 rows=482,496 loops=1)

  • Hash Cond: (fd.origen_id = d.id)
9. 2,724.008 9,468.745 ↓ 1.0 482,496 1

Hash Join (cost=53,183.62..81,218.96 rows=479,700 width=88) (actual time=5,200.358..9,468.745 rows=482,496 loops=1)

  • Hash Cond: (fd.factura_id = f.id)
10. 1,554.613 1,554.613 ↓ 1.0 483,008 1

Seq Scan on factures_detalls fd (cost=0.00..15,932.99 rows=480,129 width=8) (actual time=0.831..1,554.613 rows=483,008 loops=1)

  • Filter: (origen_tipus = 1)
  • Rows Removed by Filter: 202,271
11. 1,720.661 5,190.124 ↓ 1.0 518,952 1

Hash (cost=39,611.71..39,611.71 rows=518,553 width=84) (actual time=5,190.122..5,190.124 rows=518,952 loops=1)

  • Buckets: 524,288 Batches: 2 Memory Usage: 33,801kB
12. 3,469.463 3,469.463 ↓ 1.0 518,952 1

Seq Scan on factures f (cost=0.00..39,611.71 rows=518,553 width=84) (actual time=0.863..3,469.463 rows=518,952 loops=1)

  • Filter: (tipus <> 108)
  • Rows Removed by Filter: 10
13. 1,275.026 3,271.678 ↑ 1.0 511,601 1

Hash (cost=25,927.75..25,927.75 rows=511,675 width=8) (actual time=3,271.676..3,271.678 rows=511,601 loops=1)

  • Buckets: 524,288 Batches: 1 Memory Usage: 24,081kB
14. 1,996.652 1,996.652 ↑ 1.0 511,601 1

Seq Scan on documents d (cost=0.00..25,927.75 rows=511,675 width=8) (actual time=0.730..1,996.652 rows=511,601 loops=1)

15. 689.534 1,449.075 ↑ 1.0 316,031 1

Hash (cost=16,010.28..16,010.28 rows=316,128 width=12) (actual time=1,449.073..1,449.075 rows=316,031 loops=1)

  • Buckets: 524,288 Batches: 1 Memory Usage: 17,676kB
16. 759.541 759.541 ↑ 1.0 316,031 1

Seq Scan on expedients ex (cost=0.00..16,010.28 rows=316,128 width=12) (actual time=0.058..759.541 rows=316,031 loops=1)

17. 1.344 5.544 ↑ 1.0 642 1

Hash (cost=49.42..49.42 rows=642 width=8) (actual time=5.543..5.544 rows=642 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 34kB
18. 4.200 4.200 ↑ 1.0 642 1

Seq Scan on projectes p (cost=0.00..49.42 rows=642 width=8) (actual time=0.587..4.200 rows=642 loops=1)

19. 22.275 49.981 ↑ 1.0 9,710 1

Hash (cost=223.10..223.10 rows=9,710 width=4) (actual time=49.980..49.981 rows=9,710 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 470kB
20. 27.706 27.706 ↑ 1.0 9,710 1

Seq Scan on oficines o (cost=0.00..223.10 rows=9,710 width=4) (actual time=0.693..27.706 rows=9,710 loops=1)

21. 0.068 0.887 ↑ 1.0 19 1

Hash (cost=2.19..2.19 rows=19 width=4) (actual time=0.885..0.887 rows=19 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
22. 0.819 0.819 ↑ 1.0 19 1

Seq Scan on empreses em (cost=0.00..2.19 rows=19 width=4) (actual time=0.732..0.819 rows=19 loops=1)

Planning time : 93.550 ms
Execution time : 27,111.465 ms