explain.depesz.com

PostgreSQL's explain analyze made readable

Result: axO1

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=9,975,953.03..9,975,953.10 rows=30 width=20) (actual rows= loops=)

  • Sort Key: (max(s.data_hora_ini))
2. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=9,935,857.08..9,975,952.29 rows=30 width=20) (actual rows= loops=)

  • Hash Cond: (l.id_loja = r.id_loja)
3. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=5,267,832.12..5,307,926.93 rows=30 width=12) (actual rows= loops=)

  • Merge Cond: (l.id_loja = s.id_loja)
4. 0.000 0.000 ↓ 0.0

Sort (cost=2.04..2.11 rows=30 width=4) (actual rows= loops=)

  • Sort Key: l.id_loja
5. 0.000 0.000 ↓ 0.0

Seq Scan on loja l (cost=0.00..1.30 rows=30 width=4) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Materialize (cost=5,267,830.08..5,307,924.40 rows=28 width=12) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=5,267,830.08..5,307,924.05 rows=28 width=12) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Merge Anti Join (cost=5,267,830.08..5,298,006.54 rows=1,983,445 width=12) (actual rows= loops=)

  • Merge Cond: ((s.id_loja = sync_entidade.id_loja) AND ((s.uuid)::text = (sync_entidade.uuid)::text))
9. 0.000 0.000 ↓ 0.0

Sort (cost=532,009.09..537,801.31 rows=2,316,885 width=49) (actual rows= loops=)

  • Sort Key: s.id_loja, s.uuid
10. 0.000 0.000 ↓ 0.0

Seq Scan on sync s (cost=0.00..49,497.85 rows=2,316,885 width=49) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Materialize (cost=4,735,820.99..4,741,976.24 rows=1,231,051 width=41) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Sort (cost=4,735,820.99..4,738,898.62 rows=1,231,051 width=41) (actual rows= loops=)

  • Sort Key: sync_entidade.id_loja, sync_entidade.uuid
13. 0.000 0.000 ↓ 0.0

Seq Scan on sync_entidade (cost=0.00..4,497,681.20 rows=1,231,051 width=41) (actual rows= loops=)

  • Filter: ((entidade)::text = 'RELAY'::text)
14. 0.000 0.000 ↓ 0.0

Hash (cost=4,668,024.61..4,668,024.61 rows=28 width=12) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Subquery Scan on r (cost=4,668,024.05..4,668,024.61 rows=28 width=12) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

HashAggregate (cost=4,668,024.05..4,668,024.33 rows=28 width=12) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Hash Join (cost=106,877.12..4,667,779.40 rows=48,931 width=12) (actual rows= loops=)

  • Hash Cond: (((se.uuid)::text = (s.uuid)::text) AND (se.id_loja = s.id_loja))
18. 0.000 0.000 ↓ 0.0

Seq Scan on sync_entidade se (cost=0.00..4,497,681.20 rows=1,231,051 width=41) (actual rows= loops=)

  • Filter: ((entidade)::text = 'RELAY'::text)
19. 0.000 0.000 ↓ 0.0

Hash (cost=49,497.85..49,497.85 rows=2,316,885 width=49) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Seq Scan on sync s (cost=0.00..49,497.85 rows=2,316,885 width=49) (actual rows= loops=)