explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LrBB

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 983.208 ↓ 10.0 10 1

Limit (cost=508,484.33..65,818,336.18 rows=1 width=31) (actual time=925.036..983.208 rows=10 loops=1)

2.          

CTE linkedgf

3. 23.393 895.987 ↑ 1,374.8 23,309 1

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

  • Filter: (q.gfid IS NOT NULL)
  • Rows Removed by Filter: 299378
4. 872.594 872.594 ↑ 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.087..872.594 rows=322,687 loops=1)

5. 0.046 983.206 ↓ 10.0 10 1

Nested Loop (cost=0.42..65,309,852.26 rows=1 width=31) (actual time=925.035..983.206 rows=10 loops=1)

6. 0.360 0.360 ↑ 3.5 52 1

Seq Scan on gridfeedetail gfd (cost=0.00..58,873.25 rows=181 width=6) (actual time=0.075..0.360 rows=52 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: 1276
7. 45.812 982.800 ↓ 0.0 0 52

Index Scan using gridfee_pkey on gridfee gf (cost=0.42..360,502.64 rows=1 width=37) (actual time=18.900..18.900 rows=0 loops=52)

  • 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. 936.988 936.988 ↑ 3,744.4 8,558 52

CTE Scan on linkedgf (cost=0.00..640,889.44 rows=32,044,472 width=32) (actual time=1.081..18.019 rows=8,558 loops=52)

Planning time : 0.917 ms
Execution time : 983.415 ms