explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9uf6 : TimeSeriesSQLExplain

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 402.033 ↑ 372.0 144 1

Finalize GroupAggregate (cost=331,954.03..355,139.05 rows=53,562 width=32) (actual time=351.564..402.033 rows=144 loops=1)

  • Group Key: (date_trunc('day'::text, usage_start_date)), user_id
  • Functions: 58
  • Options: Inlining false, Optimization false, Expressions true, Deforming true
  • Timing: Generation 8.589 ms, Inlining 0.000 ms, Optimization 3.883 ms, Emission 71.224 ms, Total 83.696 ms
2. 38.106 403.780 ↑ 241.4 697 1

Gather Merge (cost=331,954.03..352,939.89 rows=168,244 width=32) (actual time=351.548..403.780 rows=697 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
3. 21.396 365.674 ↑ 302.6 139 5 / 5

Partial GroupAggregate (cost=330,953.98..331,900.35 rows=42,061 width=32) (actual time=322.679..365.674 rows=139 loops=5)

  • Group Key: (date_trunc('day'::text, usage_start_date)), user_id
4. 72.085 344.278 ↓ 4.4 186,228 5 / 5

Sort (cost=330,953.98..331,059.13 rows=42,061 width=32) (actual time=322.615..344.278 rows=186,228 loops=5)

  • Sort Key: (date_trunc('day'::text, usage_start_date))
  • Sort Method: external merge Disk: 6,048kB
  • Worker 0: Sort Method: external merge Disk: 5,248kB
  • Worker 1: Sort Method: external merge Disk: 9,008kB
  • Worker 2: Sort Method: external merge Disk: 9,016kB
  • Worker 3: Sort Method: external merge Disk: 9,016kB
5. 272.193 272.193 ↓ 4.4 186,228 5 / 5

Parallel Index Scan using user_id_index on awscost_line_item (cost=0.43..327,133.25 rows=42,061 width=32) (actual time=15.773..272.193 rows=186,228 loops=5)

  • Index Cond: (user_id = 1)
  • Filter: ((usage_start_date >= '2020-01-01 00:00:00'::timestamp without time zone) AND (cost > '0'::double precision) AND (environment_id = 1,348,115) AND (usage_end_date <= CURRENT_DATE))
  • Rows Removed by Filter: 193,382
Execution time : 406.589 ms