explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ktjL

Settings
# exclusive inclusive rows x rows loops node
1. 98.125 7,460.291 ↑ 1.0 1 1

Aggregate (cost=2,973,218.49..2,973,218.50 rows=1 width=32) (actual time=7,460.290..7,460.291 rows=1 loops=1)

  • Buffers: shared hit=1528660
  • Planning Time: 12.682 ms
  • Execution Time: 7466.454 ms
2. 318.114 7,362.166 ↑ 1.9 129,251 1

Nested Loop Left Join (cost=1,077,077.30..2,970,820.24 rows=239,825 width=16) (actual time=2,804.896..7,362.166 rows=129,251 loops=1)

  • Buffers: shared hit=1528660
3. 248.357 6,397.797 ↑ 1.9 129,251 1

Nested Loop Left Join (cost=1,077,074.71..2,343,078.30 rows=239,825 width=61) (actual time=2,804.886..6,397.797 rows=129,251 loops=1)

  • Buffers: shared hit=1395333
4. 259.407 5,373.934 ↑ 1.9 129,251 1

Nested Loop Left Join (cost=1,077,072.13..1,718,334.17 rows=239,825 width=57) (actual time=2,804.873..5,373.934 rows=129,251 loops=1)

  • Buffers: shared hit=1204889
5. 558.418 3,822.017 ↑ 1.9 129,251 1

Unique (cost=1,077,069.51..1,081,598.80 rows=239,825 width=209) (actual time=2,804.828..3,822.017 rows=129,251 loops=1)

  • Buffers: shared hit=618982
6. 1,957.560 3,263.599 ↑ 1.2 782,957 1

Sort (cost=1,077,069.51..1,079,334.15 rows=905,858 width=209) (actual time=2,804.825..3,263.599 rows=782,957 loops=1)

  • Sort Key: uba_event.userid, uba_event.visittime
  • Sort Method: quicksort Memory: 85745kB
  • Buffers: shared hit=618982
7. 1,306.039 1,306.039 ↑ 1.2 782,957 1

Index Only Scan using eg_6157f7503f7db0eb0be8f6b36d784ec2_uid_sid_id_time on uba_event (cost=0.56..987,439.73 rows=905,858 width=209) (actual time=0.040..1,306.039 rows=782,957 loops=1)

  • Index Cond: ((visittime >= '1545696000000'::bigint) AND (visittime < '1546300800000'::bigint))
  • Heap Fetches: 782957
  • Buffers: shared hit=618982
8. 258.502 1,292.510 ↓ 0.0 0 129,251

Limit (cost=2.62..2.62 rows=1 width=45) (actual time=0.009..0.010 rows=0 loops=129,251)

  • Buffers: shared hit=585907
9. 258.502 1,034.008 ↓ 0.0 0 129,251

Sort (cost=2.62..2.62 rows=1 width=45) (actual time=0.008..0.008 rows=0 loops=129,251)

  • Sort Key: uba_event_1.visittime
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=585907
10. 775.506 775.506 ↑ 1.0 1 129,251

Index Only Scan using eg_2ee9baad493990b329d791d0ad6c32a9_uid_sid_id_time on uba_event uba_event_1 (cost=0.55..2.61 rows=1 width=45) (actual time=0.005..0.006 rows=1 loops=129,251)

  • Index Cond: ((userid = (uba_event.userid)::text) AND (visittime > uba_event.visittime) AND (visittime < (uba_event.visittime + '2592000000'::bigint)))
  • Heap Fetches: 66022
  • Buffers: shared hit=585907
11. 258.502 775.506 ↓ 0.0 0 129,251

Limit (cost=2.58..2.58 rows=1 width=45) (actual time=0.005..0.006 rows=0 loops=129,251)

  • Buffers: shared hit=190444
12. 258.502 517.004 ↓ 0.0 0 129,251

Sort (cost=2.58..2.58 rows=1 width=45) (actual time=0.004..0.004 rows=0 loops=129,251)

  • Sort Key: uba_event_2.visittime
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=190444
13. 258.502 258.502 ↓ 0.0 0 129,251

Index Only Scan using eg_a6cfc74d9c2dbd7c793f3e77f98bbe92_uid_sid_id_time on uba_event uba_event_2 (cost=0.55..2.57 rows=1 width=45) (actual time=0.002..0.002 rows=0 loops=129,251)

  • Index Cond: ((userid = (uba_event_1.userid)::text) AND (visittime > uba_event_1.visittime) AND (visittime < (uba_event.visittime + '2592000000'::bigint)))
  • Heap Fetches: 31579
  • Buffers: shared hit=190444
14. 129.251 646.255 ↓ 0.0 0 129,251

Limit (cost=2.59..2.60 rows=1 width=94) (actual time=0.005..0.005 rows=0 loops=129,251)

  • Buffers: shared hit=133327
15. 258.502 517.004 ↓ 0.0 0 129,251

Sort (cost=2.59..2.60 rows=1 width=94) (actual time=0.004..0.004 rows=0 loops=129,251)

  • Sort Key: uba_event_3.visittime
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=133327
16. 258.502 258.502 ↓ 0.0 0 129,251

Index Only Scan using eg_f97618649cfda4a5f9d18d6810332a2c_uid_sid_id_time on uba_event uba_event_3 (cost=0.55..2.58 rows=1 width=94) (actual time=0.002..0.002 rows=0 loops=129,251)

  • Index Cond: ((userid = (uba_event_2.userid)::text) AND (visittime > uba_event_2.visittime) AND (visittime < (uba_event.visittime + '2592000000'::bigint)))
  • Heap Fetches: 33511
  • Buffers: shared hit=133327