explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bMMX : test3

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 2.490 ↑ 1.0 51 1

Limit (cost=241,322.95..241,323.16 rows=51 width=90) (actual time=2.435..2.490 rows=51 loops=1)

2.          

CTE user_events

3. 0.026 2.468 ↑ 10.0 51 1

WindowAgg (cost=241,319.89..241,322.95 rows=510 width=45) (actual time=2.433..2.468 rows=51 loops=1)

4. 0.000 2.442 ↑ 10.0 51 1

Limit (cost=241,319.89..241,320.15 rows=510 width=45) (actual time=2.429..2.442 rows=51 loops=1)

5. 0.063 2.442 ↑ 211.3 51 1

Sort (cost=241,319.89..241,325.28 rows=10,775 width=45) (actual time=2.429..2.442 rows=51 loops=1)

  • Sort Key: i.event_time DESC, i.event_uuid DESC
  • Sort Method: quicksort Memory: 41kB
6. 0.042 2.379 ↑ 51.6 209 1

Hash Join (cost=204,020.79..241,212.20 rows=10,775 width=45) (actual time=2.097..2.379 rows=209 loops=1)

  • Hash Cond: (i.event_definition_id = d.event_definition_id)
7. 0.283 0.283 ↑ 94.3 209 1

Index Only Scan using idx_instance1 on event_instance i (cost=190,817.18..227,972.25 rows=19,713 width=49) (actual time=0.029..0.283 rows=209 loops=1)

  • Index Cond: ((account_id = '1-7KLGH'::text) AND (event_definition_id = ANY ('{1048105,1048106,1048087,415195}'::integer[])) AND (event_time >= (('now'::cstring)::timestamp without time zone - '90 days'::interval day)) AND (event_time <= ('now'::cstring)::timestamp without time zone))
  • Filter: (CASE WHEN ((object_type IS NULL) AND (object_id IS NULL)) THEN 1 WHEN (hashed SubPlan 1) THEN 1 ELSE NULL::integer END IS NOT NULL)
  • Heap Fetches: 183
8.          

SubPlan (for Index Only Scan)

9. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_acg_objects on acg_objects (cost=0.11..190,707.82 rows=218,421 width=11) (never executed)

  • Index Cond: ((acg_id)::text = ANY ('{1-3CV382.G48558,1-3CV382,1-3CV382.58,1-3CV382.G43258,C-YQNZGB,1-5D6W5V,M-1TIM7OZ,1-5OCLF9,3-3RW041,1-6IS3A,3-984FEB,3-1CTJD9,C-3FUN9Q,3-EU0KNT,3-3RWH9W,3-Z43TJ8,3-1KQJ1R,2-2EZBD,F-A50DD5,1-5QRKWT,1-7KLGU,3-1CTJCM,3-96PCPT,3-P8WDN,C-1I55Q5R,1-5D6W5P,2-4MKQ5,3-16E17BO,3-91ZYJX,1-IZI1J,3-1LM4D5,F-ENX1W3,3-20Z36Z,C-1C3F5RC,M-243W5NL,M-23WNSO7,M-23WNSPH,M-243W5N2,M-242XCHV,3-2CSW8N,3-20Z3GY,M-23WNSQX,M-24068J2,3-20Z3EW,C-XVUI8F,M-24068HJ,C-PYGKR9,3-VSGLFJ,M-23L4181,M-1MEE8RP,M-23L0KB0,3-1EOW5VV}'::text[]))
  • Filter: (((NOT parent_user_only) OR (parent_user_only IS NULL)) AND ((akamai_internal_only = ANY ('{t,f}'::boolean[])) OR (akamai_internal_only IS NULL)))
10. 0.068 2.054 ↑ 5.0 686 1

Hash (cost=13,195.04..13,195.04 rows=3,430 width=4) (actual time=2.054..2.054 rows=686 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 57kB
11. 1.986 1.986 ↑ 5.0 686 1

Index Scan using pk_event_definition on event_definition d (cost=0.06..13,195.04 rows=3,430 width=4) (actual time=0.005..1.986 rows=686 loops=1)

  • Filter: (portal_visible = 1)
  • Rows Removed by Filter: 569
12. 2.482 2.482 ↑ 10.0 51 1

CTE Scan on user_events (cost=0.00..2.04 rows=510 width=90) (actual time=2.434..2.482 rows=51 loops=1)