explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UKiy

Settings
# exclusive inclusive rows x rows loops node
1. 0.136 832.618 ↑ 76.1 99 1

Finalize GroupAggregate (cost=4,425,425.61..4,426,531.25 rows=7,530 width=93) (actual time=831.886..832.618 rows=99 loops=1)

  • Group Key: paradas_veiculos.pvplaca, (to_char(paradas_veiculos.pvdataevento, 'dd/mm/yyyy'::text)), veiculos.veprefixo, veiculos.vedescricao, bilhetes.bimodulo
2. 0.000 832.482 ↑ 22.8 275 1

Gather Merge (cost=4,425,425.61..4,426,252.00 rows=6,276 width=77) (actual time=831.871..832.482 rows=275 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 1.062 2,422.713 ↑ 34.1 92 3

Partial GroupAggregate (cost=4,424,425.58..4,424,527.57 rows=3,138 width=77) (actual time=807.164..807.571 rows=92 loops=3)

  • Group Key: paradas_veiculos.pvplaca, (to_char(paradas_veiculos.pvdataevento, 'dd/mm/yyyy'::text)), veiculos.veprefixo, veiculos.vedescricao, bilhetes.bimodulo
4. 10.365 2,421.651 ↑ 2.6 1,216 3

Sort (cost=4,424,425.58..4,424,433.43 rows=3,138 width=69) (actual time=807.149..807.217 rows=1,216 loops=3)

  • Sort Key: paradas_veiculos.pvplaca, (to_char(paradas_veiculos.pvdataevento, 'dd/mm/yyyy'::text)), veiculos.veprefixo, veiculos.vedescricao, bilhetes.bimodulo
  • Sort Method: quicksort Memory: 228kB
5. 806.592 2,411.286 ↑ 2.6 1,216 3

Nested Loop Left Join (cost=36.24..4,424,243.33 rows=3,138 width=69) (actual time=2.762..803.762 rows=1,216 loops=3)

  • -> Index Scan using bilhetes_bidataevento_idx on bilhetes (cost=0.57..1347.66 rows=1 width=21) (actual time=0.116..0.220 rows=1 loops=3611) Index Cond: (bidataevento = paradas_veiculos.pvdataevento)
6. 157.743 1,604.694 ↑ 2.6 1,204 3

Hash Join (cost=35.67..195,236.82 rows=3,138 width=41) (actual time=1.168..534.898 rows=1,204 loops=3)

  • Hash Cond: ((paradas_veiculos.pvplaca)::text = (veiculos.veplaca)::text)
  • -> Hash (cost=35.17..35.17 rows=5 width=25) (actual time=0.109..0.109 rows=5 loops=3) Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Filter: (biplaca = (paradas_veiculos.pvplaca)::text)
  • Rows Removed by Filter: 23
7. 1,446.951 1,446.951 ↑ 1.3 595,993 3

Parallel Index Scan Backward using paradas_veiculos_pvdataevento_idx_desc on paradas_veiculos (cost=0.44..192,362.82 rows=748,638 width=25) (actual time=0.189..482.317 rows=595,993 loops=3)

  • Index Cond: ((pvdataevento >= '2018-10-01 00:00:00'::timestamp without time zone) AND (pvdataevento <= '2018-10-30 23:59:00'::timestamp without time zone))
  • -> Bitmap Heap Scan on veiculos (cost=21.43..35.17 rows=5 width=25) (actual time=0.073..0.100 rows=5 loops=3) Recheck Cond: (vecodigo = ANY ('{1046,1036,1045,746,202}'::integer[]))
  • Heap Blocks: exact=5
  • -> Bitmap Index Scan on veiculos_pkey (cost=0.00..21.43 rows=5 width=0) (actual time=0.063..0.063 rows=5 loops=3) Index Cond: (vecodigo = ANY ('{1046,1036,1045,746,202}'::integer[]))