explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FFQo

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 37,995.966 ↑ 1.0 1 1

Limit (cost=17.48..17.49 rows=1 width=138) (actual time=37,995.966..37,995.966 rows=1 loops=1)

2. 61.011 37,995.964 ↑ 1.0 1 1

Sort (cost=17.48..17.49 rows=1 width=138) (actual time=37,995.964..37,995.964 rows=1 loops=1)

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

Nested Loop Left Join (cost=3.16..17.47 rows=1 width=138) (actual time=3.979..37,934.953 rows=37,785 loops=1)

4. 25.126 29,700.168 ↓ 37,785.0 37,785 1

Nested Loop Left Join (cost=2.72..15.14 rows=1 width=140) (actual time=3.972..29,700.168 rows=37,785 loops=1)

5. 29.276 21,589.052 ↓ 37,785.0 37,785 1

Nested Loop Left Join (cost=2.29..12.80 rows=1 width=144) (actual time=3.966..21,589.052 rows=37,785 loops=1)

6. 59.308 13,436.001 ↓ 37,785.0 37,785 1

Nested Loop (cost=1.86..10.47 rows=1 width=148) (actual time=3.952..13,436.001 rows=37,785 loops=1)

7. 10.949 6,877.673 ↓ 37,785.0 37,785 1

Nested Loop (cost=1.29..7.97 rows=1 width=127) (actual time=3.037..6,877.673 rows=37,785 loops=1)

8. 0.857 0.857 ↑ 1.0 1 1

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

  • Index Cond: ("integrationId" = 79,654,257)
9. 21.322 6,865.867 ↓ 37,785.0 37,785 1

Nested Loop (cost=0.86..5.31 rows=1 width=109) (actual time=2.178..6,865.867 rows=37,785 loops=1)

10. 0.968 0.968 ↑ 1.0 1 1

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

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

Index Scan using "taxes_issuerId_recipientId_icmsId_ncm_goal_operationType_idx" on taxes tax0_ (cost=0.57..2.79 rows=1 width=91) (actual time=1.208..6,843.577 rows=37,785 loops=1)

  • Index Cond: (("issuerId" = issuer1_.id) AND ("recipientId" = recipient2_.id) AND ((ncm)::text = '19059090'::text) AND ((goal)::text = 'NORMAL'::text) AND (("operationType")::text = 'OUT'::text))
12. 6,499.020 6,499.020 ↑ 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.172..0.172 rows=1 loops=37,785)

  • Index Cond: (id = tax0_."icmsId")
13. 8,123.775 8,123.775 ↑ 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.215..0.215 rows=1 loops=37,785)

  • Index Cond: (tax0_.pisid = id)
14. 8,085.990 8,085.990 ↑ 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.214..0.214 rows=1 loops=37,785)

  • Index Cond: (tax0_.cofinsid = id)
15. 8,199.345 8,199.345 ↑ 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.217..0.217 rows=1 loops=37,785)

  • Index Cond: (tax0_.ipiid = id)
Planning time : 5.065 ms
Execution time : 37,996.095 ms