explain.depesz.com

PostgreSQL's explain analyze made readable

Result: eIEQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.484 30,714.191 ↓ 1,000.0 1,000 1

Limit (cost=508,484.33..73,749,013.08 rows=1 width=31) (actual time=914.766..30,714.191 rows=1,000 loops=1)

2.          

CTE linkedgf

3. 24.000 904.088 ↑ 1,374.8 23,309 1

Subquery Scan on q (cost=0.00..508,483.91 rows=32,044,472 width=32) (actual time=0.041..904.088 rows=23,309 loops=1)

  • Filter: (q.gfid IS NOT NULL)
  • Rows Removed by Filter: 299378
4. 880.088 880.088 ↑ 99.8 322,687 1

Seq Scan on invoice (cost=0.00..186,428.91 rows=32,205,500 width=1,999) (actual time=0.041..880.088 rows=322,687 loops=1)

5. 15.019 30,713.707 ↓ 1,000.0 1,000 1

Nested Loop (cost=0.42..73,240,529.16 rows=1 width=31) (actual time=914.766..30,713.707 rows=1,000 loops=1)

6. 203.187 203.187 ↓ 70.4 14,297 1

Seq Scan on gridfeedetail gfd (cost=0.00..58,495.38 rows=203 width=6) (actual time=0.017..203.187 rows=14,297 loops=1)

  • Filter: ((todate = fromdate) AND ((globalizationcode)::text = ANY ('{0060,0080,0081,0160,0170,9060,9080,9081,9160,9170,AUTRE,FRAIS,FRAIS_HC,PREST,REM}'::text[])))
  • Rows Removed by Filter: 712608
7. 16,362.691 30,495.501 ↓ 0.0 0 14,297

Index Scan using gridfee_pkey on gridfee gf (cost=0.42..360,502.62 rows=1 width=37) (actual time=2.133..2.133 rows=0 loops=14,297)

  • Index Cond: ((gridfeeid)::text = (gfd.gridfeeid)::text)
  • Filter: ((todate = fromdate) AND (NOT (SubPlan 2)))
  • Rows Removed by Filter: 1
8.          

SubPlan (for Index Scan)

9. 14,132.810 14,132.810 ↑ 2,799.6 11,446 14,290

CTE Scan on linkedgf (cost=0.00..640,889.44 rows=32,044,472 width=32) (actual time=0.000..0.989 rows=11,446 loops=14,290)

Planning time : 0.693 ms
Execution time : 30,714.706 ms