11------------------------------------------------------------------------------------------------------------------------
22Index usage for query Q1:
33
4- Sort (cost=69519427.00..69519427.03 rows=13 width=40)
4+ Sort (cost=69172569.47..69172569.50 rows=12 width=40)
55 Sort Key: (count(*)) DESC
6- -> Finalize GroupAggregate (cost=69519423.40..69519426.75 rows=13 width=40)
6+ -> Finalize GroupAggregate (cost=69172566.16..69172569.26 rows=12 width=40)
77 Group Key: (((data -> 'commit'::text) ->> 'collection'::text))
8- -> Gather Merge (cost=69519423.40..69519426.43 rows=26 width=40)
8+ -> Gather Merge (cost=69172566.16..69172568.96 rows=24 width=40)
99 Workers Planned: 2
10- -> Sort (cost=69518423.37..69518423.40 rows=13 width=40)
10+ -> Sort (cost=69171566.13..69171566.16 rows=12 width=40)
1111 Sort Key: (((data -> 'commit'::text) ->> 'collection'::text))
12- -> Partial HashAggregate (cost=69518422.94..69518423.13 rows=13 width=40)
12+ -> Partial HashAggregate (cost=69171565.74..69171565.92 rows=12 width=40)
1313 Group Key: ((data -> 'commit'::text) ->> 'collection'::text)
14- -> Parallel Seq Scan on bluesky (cost=0.00..67846651.20 rows=334354347 width=32)
14+ -> Parallel Seq Scan on bluesky (cost=0.00..67495020.80 rows=335308987 width=32)
1515 JIT:
1616 Functions: 7
1717 Options: Inlining true, Optimization true, Expressions true, Deforming true
1818
1919------------------------------------------------------------------------------------------------------------------------
2020Index usage for query Q2:
2121
22- Sort (cost=534467372.01..534467372.04 rows=13 width=48)
22+ Sort (cost=531988506.66..531988506.69 rows=12 width=48)
2323 Sort Key: (count(*)) DESC
24- -> GroupAggregate (cost=438967879.95..534467371.77 rows=13 width=48)
24+ -> GroupAggregate (cost=436041090.60..531988506.44 rows=12 width=48)
2525 Group Key: (((data -> 'commit'::text) ->> 'collection'::text))
26- -> Gather Merge (cost=438967879.95..526916003.64 rows=755136794 width=569 )
26+ -> Gather Merge (cost=436041090.60..524401719.92 rows=758678634 width=566 )
2727 Workers Planned: 2
28- -> Sort (cost=438966879.92..439753480.75 rows=314640331 width=569 )
28+ -> Sort (cost=436040090.57..436830380.82 rows=316116098 width=566 )
2929 Sort Key: (((data -> 'commit'::text) ->> 'collection'::text)), ((data ->> 'did'::text))
30- -> Parallel Seq Scan on bluesky (cost=0.00..71927510.45 rows=314640331 width=569 )
30+ -> Parallel Seq Scan on bluesky (cost=0.00..71590418.69 rows=316116098 width=566 )
3131 Filter: (((data ->> 'kind'::text) = 'commit'::text) AND (((data -> 'commit'::text) ->> 'operation'::text) = 'create'::text))
3232 JIT:
3333 Functions: 8
@@ -36,15 +36,15 @@ Index usage for query Q2:
3636------------------------------------------------------------------------------------------------------------------------
3737Index usage for query Q3:
3838
39- Finalize GroupAggregate (cost=134562855.16..206828438.13 rows=473420435 width=72)
39+ Finalize GroupAggregate (cost=134041870.72..206094379.64 rows=472024562 width=72)
4040 Group Key: (EXTRACT(hour FROM to_timestamp(((((data ->> 'time_us'::text))::bigint / 1000000))::double precision))), (((data -> 'commit'::text) ->> 'collection'::text))
41- -> Gather Merge (cost=134562855.16..188483396.27 rows=394517030 width=72)
41+ -> Gather Merge (cost=134041870.72..187803427.86 rows=393353802 width=72)
4242 Workers Planned: 2
43- -> Partial GroupAggregate (cost=134561855.14..142945342.03 rows=197258515 width=72)
43+ -> Partial GroupAggregate (cost=134040870.70..142399638.99 rows=196676901 width=72)
4444 Group Key: (EXTRACT(hour FROM to_timestamp(((((data ->> 'time_us'::text))::bigint / 1000000))::double precision))), (((data -> 'commit'::text) ->> 'collection'::text))
45- -> Sort (cost=134561855.14..135055001.43 rows=197258515 width=64)
45+ -> Sort (cost=134040870.70..134532562.95 rows=196676901 width=64)
4646 Sort Key: (EXTRACT(hour FROM to_timestamp(((((data ->> 'time_us'::text))::bigint / 1000000))::double precision))), (((data -> 'commit'::text) ->> 'collection'::text))
47- -> Parallel Seq Scan on bluesky (cost=0.00..77718225.92 rows=197258515 width=64)
47+ -> Parallel Seq Scan on bluesky (cost=0.00..77369022.11 rows=196676901 width=64)
4848 Filter: (((data ->> 'kind'::text) = 'commit'::text) AND (((data -> 'commit'::text) ->> 'operation'::text) = 'create'::text) AND (((data -> 'commit'::text) ->> 'collection'::text) = ANY ('{app.bsky.feed.post,app.bsky.feed.repost,app.bsky.feed.like}'::text[])))
4949 JIT:
5050 Functions: 11
@@ -53,39 +53,42 @@ Index usage for query Q3:
5353------------------------------------------------------------------------------------------------------------------------
5454Index usage for query Q4:
5555
56- Limit (cost=116709176.13..116709176.13 rows=3 width=40)
57- -> Sort (cost=116709176.13..116885878.13 rows=70680802 width=40)
56+ Limit (cost=94926225.45..94926225.46 rows=3 width=40)
57+ -> Sort (cost=94926225.45..94926749.83 rows=209751 width=40)
5858 Sort Key: (min(('1970-01-01 00:00:00+00'::timestamp with time zone + ('00:00:00.000001'::interval * (((data ->> 'time_us'::text))::bigint)::double precision))))
59- -> Finalize GroupAggregate (cost=106788266.40..115795640.01 rows=70680802 width=40)
59+ -> Finalize GroupAggregate (cost=94869849.75..94923514.46 rows=209751 width=40)
6060 Group Key: ((data ->> 'did'::text))
61- -> Gather Merge (cost=106788266.40..114617626.65 rows=58900668 width=40)
61+ -> Gather Merge (cost=94869849.75..94918795.06 rows=419502 width=40)
6262 Workers Planned: 2
63- -> Partial GroupAggregate (cost=106787266.37..107818028.06 rows=29450334 width=40)
64- Group Key: ((data ->> 'did'::text))
65- -> Sort (cost=106787266.37..106860892.21 rows=29450334 width=569)
66- Sort Key: ((data ->> 'did'::text))
67- -> Parallel Seq Scan on bluesky (cost=0.00..72935592.23 rows=29450334 width=569)
63+ -> Sort (cost=94868849.72..94869374.10 rows=209751 width=40)
64+ Sort Key: ((data ->> 'did'::text))
65+ -> Partial HashAggregate (cost=90626411.32..94844573.00 rows=209751 width=40)
66+ Group Key: (data ->> 'did'::text)
67+ Planned Partitions: 32
68+ -> Parallel Seq Scan on bluesky (cost=0.00..72597573.04 rows=29166978 width=566)
6869 Filter: (((data ->> 'kind'::text) = 'commit'::text) AND (((data -> 'commit'::text) ->> 'operation'::text) = 'create'::text) AND (((data -> 'commit'::text) ->> 'collection'::text) = 'app.bsky.feed.post'::text))
6970 JIT:
70- Functions: 13
71+ Functions: 10
7172 Options: Inlining true, Optimization true, Expressions true, Deforming true
7273
7374------------------------------------------------------------------------------------------------------------------------
7475Index usage for query Q5:
7576
76- Limit (cost=117901914.66..117901914.66 rows=3 width=64)
77- -> Sort (cost=117901914.66..118078616.66 rows=70680802 width=64)
77+ Limit (cost=95439986.96..95439986.96 rows=3 width=64)
78+ -> Sort (cost=95439986.96..95440511.33 rows=209751 width=64)
7879 Sort Key: ((EXTRACT(epoch FROM (max(('1970-01-01 00:00:00+00'::timestamp with time zone + ('00:00:00.000001'::interval * (((data ->> 'time_us'::text))::bigint)::double precision))) - min(('1970-01-01 00:00:00+00'::timestamp with time zone + ('00:00:00.000001'::interval * (((data ->> 'time_us'::text))::bigint)::double precision))))) * '1000'::numeric)) DESC
79- -> Finalize GroupAggregate (cost=106788266.40..116988378.54 rows=70680802 width=64)
80+ -> Finalize GroupAggregate (cost=95380989.36..95437275.96 rows=209751 width=64)
8081 Group Key: ((data ->> 'did'::text))
81- -> Gather Merge (cost=106788266.40..115133007.49 rows=58900668 width=48)
82+ -> Gather Merge (cost=95380989.36..95429934.68 rows=419502 width=48)
8283 Workers Planned: 2
83- -> Partial GroupAggregate (cost=106787266.37..108333408.91 rows=29450334 width=48)
84- Group Key: ((data ->> 'did'::text))
85- -> Sort (cost=106787266.37..106860892.21 rows=29450334 width=569)
86- Sort Key: ((data ->> 'did'::text))
87- -> Parallel Seq Scan on bluesky (cost=0.00..72935592.23 rows=29450334 width=569)
84+ -> Sort (cost=95379989.34..95380513.71 rows=209751 width=48)
85+ Sort Key: ((data ->> 'did'::text))
86+ -> Partial HashAggregate (cost=91136833.44..95354995.11 rows=209751 width=48)
87+ Group Key: (data ->> 'did'::text)
88+ Planned Partitions: 32
89+ -> Parallel Seq Scan on bluesky (cost=0.00..72597573.04 rows=29166978 width=566)
8890 Filter: (((data ->> 'kind'::text) = 'commit'::text) AND (((data -> 'commit'::text) ->> 'operation'::text) = 'create'::text) AND (((data -> 'commit'::text) ->> 'collection'::text) = 'app.bsky.feed.post'::text))
8991 JIT:
90- Functions: 13
91- Options: Inlining true, Optimization true, Expressions true, Deforming true
92+ Functions: 10
93+ Options: Inlining true, Optimization true, Expressions true, Deforming true
94+
0 commit comments