I'm fine with merging this as is, but the retrieval part might get rewritten per the discussion surrounding statement size filtering