explain.depesz.com

PostgreSQL's explain analyze made readable

Result: v2vV : slow

Settings
# exclusive inclusive rows x rows loops node
1. 18.936 7,614.250 ↑ 2.0 43 1

GroupAggregate (cost=84,835.35..84,839.05 rows=87 width=228) (actual time=7,591.359..7,614.250 rows=43 loops=1)

  • Group Key: sims.iccid, (("ts-values".value_meta ->> 'carrierCountryCode'::text))
2. 53.591 7,595.314 ↓ 140.7 12,239 1

Sort (cost=84,835.35..84,835.57 rows=87 width=279) (actual time=7,591.347..7,595.314 rows=12,239 loops=1)

  • Sort Key: sims.iccid, (("ts-values".value_meta ->> 'carrierCountryCode'::text))
  • Sort Method: external merge Disk: 3376kB
3. 196.343 7,541.723 ↓ 140.7 12,239 1

Nested Loop Left Join (cost=1,013.25..84,832.55 rows=87 width=279) (actual time=7,157.680..7,541.723 rows=12,239 loops=1)

  • Join Filter: ((sims.iccid)::text = ("ts-metrics".dimensions ->> 'iccid'::text))
  • Rows Removed by Join Filter: 515099
4. 0.249 0.249 ↓ 10.8 43 1

Index Scan using sims_clientslug_index on sims (cost=0.28..58.07 rows=4 width=73) (actual time=0.017..0.249 rows=43 loops=1)

  • Index Cond: (("clientSlug")::text = 'clientA'::text)
  • Filter: (("providerSlug")::text = 'providerX'::text)
  • Rows Removed by Filter: 14
5. 204.729 7,345.131 ↓ 1.0 12,263 43

Materialize (cost=1,012.98..83,953.06 rows=12,166 width=268) (actual time=21.939..170.817 rows=12,263 loops=43)

6. 17.566 7,140.402 ↓ 1.0 12,263 1

Gather (cost=1,012.98..83,892.23 rows=12,166 width=268) (actual time=942.915..7,140.402 rows=12,263 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
7. 2.345 7,122.836 ↑ 1.2 4,088 3

Hash Join (cost=12.97..81,675.63 rows=5,069 width=268) (actual time=938.476..7,122.836 rows=4,088 loops=3)

  • Hash Cond: ("ts-values".metric_id = "ts-metrics".id)
8. 7,120.266 7,120.266 ↑ 1.2 4,088 3

Parallel Seq Scan on "ts-values" (cost=0.00..81,598.80 rows=5,069 width=178) (actual time=938.143..7,120.266 rows=4,088 loops=3)

  • Filter: (("timestamp" >= '2019-01-04 07:00:00+00'::timestamp with time zone) AND ("timestamp" <= '2019-01-05 06:59:59.999+00'::timestamp with time zone))
  • Rows Removed by Filter: 429186
9. 0.116 0.225 ↓ 1.0 311 3

Hash (cost=9.10..9.10 rows=310 width=98) (actual time=0.225..0.225 rows=311 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 48kB
10. 0.109 0.109 ↓ 1.0 311 3

Seq Scan on "ts-metrics" (cost=0.00..9.10 rows=310 width=98) (actual time=0.016..0.109 rows=311 loops=3)