Skip to content

Optimization for filtering on long joins #9058

@jackfischer

Description

@jackfischer

Developers just cannot get enough of writing queries like this

select Agent {
    id
} filter (
    .editVersion.customPrompt.questionPresets.id = <uuid>$questionPresetId
)

versus queries like this

select QuestionPreset {
  agentId := .prompt.agentVersion.agent.id
}
filter .id = <uuid>$questionPresetId

This one was 800ms vs 0.1ms. Unless there's a deep reason I'm not seeing that it should materialize the full agent -> editVersion -> customPrompt -> questionPresets join, we should find a way to prevent that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions