explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Nqqg

Settings
# exclusive inclusive rows x rows loops node
1. 989.184 338,018.634 ↓ 11,069.5 6,398,188 1

Subquery Scan on tt (cost=6,305,190.97..6,309,522.93 rows=578 width=252) (actual time=317,312.121..338,018.634 rows=6,398,188 loops=1)

  • Filter: (tt.row_no = 1)
  • Rows Removed by Filter: 282427
2.          

CTE prods

3. 0.000 266,483.506 ↓ 57.8 6,680,615 1

Gather (cost=1,000.00..6,279,740.73 rows=115,519 width=244) (actual time=0.457..266,483.506 rows=6,680,615 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 275,669.569 275,669.569 ↓ 46.3 2,226,872 3

Parallel Seq Scan on pbi_results results (cost=0.00..6,267,188.83 rows=48,133 width=244) (actual time=0.344..275,669.569 rows=2,226,872 loops=3)

  • Filter: ((document ->> 'client_id'::text) = 'pilulka'::text)
  • Rows Removed by Filter: 5480091
5. 8,194.640 337,029.450 ↓ 57.8 6,680,615 1

WindowAgg (cost=25,450.24..28,338.22 rows=115,519 width=252) (actual time=317,312.119..337,029.450 rows=6,680,615 loops=1)

6. 52,744.293 328,834.810 ↓ 57.8 6,680,615 1

Sort (cost=25,450.24..25,739.04 rows=115,519 width=244) (actual time=317,312.091..328,834.810 rows=6,680,615 loops=1)

  • Sort Key: prods.products_internal_code, prods.results_shop, prods.results_date, prods.results_price_vat
  • Sort Method: external merge Disk: 1110680kB
7. 276,090.517 276,090.517 ↓ 57.8 6,680,615 1

CTE Scan on prods (cost=0.00..2,310.38 rows=115,519 width=244) (actual time=0.461..276,090.517 rows=6,680,615 loops=1)

Planning time : 0.221 ms
Execution time : 338,471.101 ms