explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bjJ9

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 66,556.963 ↑ 1.0 1 1

Limit (cost=17.48..17.48 rows=1 width=137) (actual time=66,556.962..66,556.963 rows=1 loops=1)

2. 73.794 66,556.961 ↑ 1.0 1 1

Sort (cost=17.48..17.48 rows=1 width=137) (actual time=66,556.961..66,556.961 rows=1 loops=1)

  • Sort Key: tax0_."createdAt" DESC
  • Sort Method: top-N heapsort Memory: 25kB
3. 44.415 66,483.167 ↓ 37,785.0 37,785 1

Nested Loop Left Join (cost=3.15..17.47 rows=1 width=137) (actual time=4.225..66,483.167 rows=37,785 loops=1)

4. 39.257 49,926.707 ↓ 37,785.0 37,785 1

Nested Loop Left Join (cost=2.72..15.13 rows=1 width=139) (actual time=4.221..49,926.707 rows=37,785 loops=1)

5. 68.282 33,488.760 ↓ 37,785.0 37,785 1

Nested Loop Left Join (cost=2.29..12.80 rows=1 width=143) (actual time=4.217..33,488.760 rows=37,785 loops=1)

6. 53.525 16,946.218 ↓ 37,785.0 37,785 1

Nested Loop (cost=1.85..10.46 rows=1 width=147) (actual time=4.212..16,946.218 rows=37,785 loops=1)

7. 15.512 7,257.518 ↓ 37,785.0 37,785 1

Nested Loop (cost=1.29..7.96 rows=1 width=126) (actual time=3.062..7,257.518 rows=37,785 loops=1)

8. 1.378 1.378 ↑ 1.0 1 1

Index Scan using idx_rec_integrationid on recipients recipient2_ (cost=0.43..2.65 rows=1 width=26) (actual time=1.377..1.378 rows=1 loops=1)

  • Index Cond: ("integrationId" = 79,654,257)
9. 28.715 7,240.628 ↓ 37,785.0 37,785 1

Nested Loop (cost=0.85..5.30 rows=1 width=108) (actual time=1.681..7,240.628 rows=37,785 loops=1)

10. 0.993 0.993 ↑ 1.0 1 1

Index Scan using idx_integrationid on issuers issuer1_ (cost=0.29..2.51 rows=1 width=26) (actual time=0.992..0.993 rows=1 loops=1)

  • Index Cond: ("integrationId" = 1,454,184)
11. 7,210.920 7,210.920 ↓ 37,785.0 37,785 1

Index Scan using idx_taxes_query_top on taxes tax0_ (cost=0.56..2.79 rows=1 width=90) (actual time=0.684..7,210.920 rows=37,785 loops=1)

  • Index Cond: (("issuerId" = issuer1_.id) AND ("recipientId" = recipient2_.id) AND ((ncm)::text = '19059090'::text))
12. 9,635.175 9,635.175 ↑ 1.0 1 37,785

Index Scan using icms_pkey on icms icms3_ (cost=0.57..2.50 rows=1 width=29) (actual time=0.255..0.255 rows=1 loops=37,785)

  • Index Cond: (id = tax0_."icmsId")
13. 16,474.260 16,474.260 ↑ 1.0 1 37,785

Index Scan using pis_pkey on pis pis4_ (cost=0.43..2.33 rows=1 width=28) (actual time=0.436..0.436 rows=1 loops=37,785)

  • Index Cond: (tax0_.pisid = id)
14. 16,398.690 16,398.690 ↑ 1.0 1 37,785

Index Scan using cofins_pkey on cofins cofins5_ (cost=0.43..2.33 rows=1 width=28) (actual time=0.434..0.434 rows=1 loops=37,785)

  • Index Cond: (tax0_.cofinsid = id)
15. 16,512.045 16,512.045 ↑ 1.0 1 37,785

Index Scan using ipi_pkey on ipi ipi6_ (cost=0.43..2.33 rows=1 width=30) (actual time=0.437..0.437 rows=1 loops=37,785)

  • Index Cond: (tax0_.ipiid = id)
Planning time : 42.970 ms
Execution time : 66,560.792 ms