explain.depesz.com

PostgreSQL's explain analyze made readable

Result: n3IH : Optimization for: fff; plan #qeC3X

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.725 8,557.971 ↑ 6.7 2,168 1

WindowAgg (cost=7,779,116.07..7,779,478.75 rows=14,507 width=79) (actual time=8,557.119..8,557.971 rows=2,168 loops=1)

2. 1.366 8,557.246 ↑ 6.7 2,168 1

Sort (cost=7,779,116.07..7,779,152.34 rows=14,507 width=71) (actual time=8,557.113..8,557.246 rows=2,168 loops=1)

  • Sort Key: "C"."rungUserId", "C"."throttleId", "C".status, "C"."whenInserted
  • Sort Method: quicksort Memory: 401kB
3. 0.603 8,555.880 ↑ 6.7 2,168 1

WindowAgg (cost=7,777,786.91..7,778,113.31 rows=14,507 width=71) (actual time=8,555.147..8,555.880 rows=2,168 loops=1)

4. 1.827 8,555.277 ↑ 6.7 2,168 1

Sort (cost=7,777,786.91..7,777,823.17 rows=14,507 width=63) (actual time=8,555.141..8,555.277 rows=2,168 loops=1)

  • Sort Key: "C"."rungHostId", "C".status, "C"."whenInserted
  • Sort Method: quicksort Memory: 401kB
5. 2,726.911 8,553.450 ↑ 6.7 2,168 1

Seq Scan on "RungServerCorrelation" "C" (cost=0.00..7,776,784.15 rows=14,507 width=63) (actual time=4,675.687..8,553.450 rows=2,168 loops=1)

  • Filter: (((status)::text = 'Q'::text) OR (((status)::text = 'F'::text) AND ((("whenUpdated")::timestamp with time zone + ((to_char(LEAST(('20'::double precision * ('2'::double precision ^ ("retryCount")::double precision)), '3600'::double precision), 'FM999999'::text) || ' seconds'::text))::interval) <= now())) OR (((status)::text = 'R'::text) AND ("messageCount" = (SubPlan 1)) AND (NOT (SubPlan 2))))
  • Rows Removed by Filter: 5800524
6.          

SubPlan (forSeq Scan)

7. 0.000 5,802.691 ↑ 1.0 1 5,802,691

Aggregate (cost=0.50..0.51 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=5,802,691)

8. 5,802.691 5,802.691 ↓ 0.0 0 5,802,691

Index Only Scan using "RungServerMessage_rungCorrelationId_status" on "RungServerMessage" "M" (cost=0.28..0.50 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=5,802,691)

  • Index Cond: ("rungCorrelationId" = "C"."rungCorrelationId")
  • Heap Fetches: 2168
9. 23.848 23.848 ↓ 0.0 0 2,168

Index Only Scan using "RungServerCorrelation_comp" on "RungServerCorrelation" "CI" (cost=0.56..0.78 rows=1 width=0) (actual time=0.011..0.011 rows=0 loops=2,168)

  • Index Cond: (("rungHostId" = ("C"."rungHostId")::text) AND ("rungUserId" = ("C"."rungUserId")::text) AND ("sequentialId" = ("C"."sequentialId")::text) AND ("whenInserted" < ("C"."whenInserted")::timestamp with time zone))
  • Heap Fetches: 0