explain.depesz.com

PostgreSQL's explain analyze made readable

Result: A3eE

Settings
# exclusive inclusive rows x rows loops node
1. 1.421 688.920 ↑ 37.9 613 1

Sort (cost=30,042.25..30,100.35 rows=23,238 width=56) (actual time=688.778..688.920 rows=613 loops=1)

  • Sort Key: tpe."tpeNome
  • Sort Method: quicksort Memory: 111kB
2. 13.476 687.499 ↑ 37.9 613 1

HashAggregate (cost=28,124.63..28,357.01 rows=23,238 width=56) (actual time=687.080..687.499 rows=613 loops=1)

  • Group Key: tpe."tpeID
  • Filter: (sum(thfdcu."thfdcuQuantidadePJ") > 0)
  • Rows Removed by Filter: 96
3. 272.164 674.023 ↓ 1.4 34,728 1

Hash Join (cost=10,918.40..27,875.85 rows=24,878 width=48) (actual time=198.072..674.023 rows=34,728 loops=1)

  • Hash Cond: (thfdcu."thfdcuthdcuID" = thdcu."thdcuID")
4. 263.066 263.066 ↑ 1.0 802,664 1

Seq Scan on "TabHistoricoFaixaDistribuicaoClienteUsuario" thfdcu (cost=0.00..13,685.83 rows=806,083 width=12) (actual time=0.460..263.066 rows=802,664 loops=1)

5. 1.945 138.793 ↓ 1.4 4,341 1

Hash (cost=10,879.01..10,879.01 rows=3,151 width=44) (actual time=138.793..138.793 rows=4,341 loops=1)

  • Buckets: 8192 (originally 4096) Batches: 1 (originally 1) Memory Usage: 470kB
6. 27.794 136.848 ↓ 1.4 4,341 1

Hash Join (cost=8,482.82..10,879.01 rows=3,151 width=44) (actual time=29.004..136.848 rows=4,341 loops=1)

  • Hash Cond: (thdcu."thdcutscID" = tsc."tscID")
7. 88.431 88.431 ↑ 1.0 100,333 1

Seq Scan on "TabHistoricoDistribuicaoClienteUsuario" thdcu (cost=0.00..1,981.86 rows=102,086 width=8) (actual time=0.005..88.431 rows=100,333 loops=1)

8. 0.525 20.623 ↓ 1.1 1,000 1

Hash (cost=8,471.88..8,471.88 rows=875 width=44) (actual time=20.623..20.623 rows=1,000 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 101kB
9. 1.091 20.098 ↓ 1.1 1,000 1

Nested Loop (cost=102.88..8,471.88 rows=875 width=44) (actual time=2.409..20.098 rows=1,000 loops=1)

10. 0.805 16.007 ↓ 1.1 1,000 1

Hash Join (cost=102.59..7,642.97 rows=875 width=8) (actual time=2.390..16.007 rows=1,000 loops=1)

  • Hash Cond: (tos."tostclID" = tcl."tclID")
11. 1.434 13.167 ↓ 1.1 1,000 1

Nested Loop (cost=0.70..7,529.06 rows=875 width=8) (actual time=0.329..13.167 rows=1,000 loops=1)

12. 0.593 9.733 ↓ 1.1 1,000 1

Nested Loop (cost=0.42..7,253.83 rows=875 width=8) (actual time=0.310..9.733 rows=1,000 loops=1)

13. 4.140 4.140 ↓ 1.1 1,000 1

Seq Scan on "TabSICIColetaMensal" tsc (cost=0.00..1,130.26 rows=875 width=8) (actual time=0.274..4.140 rows=1,000 loops=1)

  • Filter: (("tscMes" = 12) AND ("tscAno" = 2018))
  • Rows Removed by Filter: 27594
14. 5.000 5.000 ↑ 1.0 1 1,000

Index Scan using "TabAssessoriaCliente_tacID" on "TabAssessoriaCliente" tac (cost=0.42..6.99 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=1,000)

  • Index Cond: ("tacID" = tsc."tsctacID")
15. 2.000 2.000 ↑ 1.0 1 1,000

Index Scan using "TabOrdemServico_Unique_tosID_tostemID" on "TabOrdemServico" tos (cost=0.28..0.30 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1,000)

  • Index Cond: ("tosID" = tac."tactosID")
16. 0.978 2.035 ↓ 1.0 3,119 1

Hash (cost=63.06..63.06 rows=3,106 width=8) (actual time=2.035..2.035 rows=3,119 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 154kB
17. 1.057 1.057 ↓ 1.0 3,119 1

Seq Scan on "TabCliente" tcl (cost=0.00..63.06 rows=3,106 width=8) (actual time=0.013..1.057 rows=3,119 loops=1)

18. 3.000 3.000 ↑ 1.0 1 1,000

Index Scan using "TabPessoaID" on "TabPessoa" tpe (cost=0.29..0.94 rows=1 width=40) (actual time=0.003..0.003 rows=1 loops=1,000)

  • Index Cond: ("tpeID" = tcl."tcltpeID")
Planning time : 4.789 ms
Execution time : 689.475 ms