Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where Clause analysis gives warnings when ANN sort used with no filtering #1621

Open
amorton opened this issue Oct 30, 2024 · 0 comments
Open

Comments

@amorton
Copy link
Contributor

amorton commented Oct 30, 2024

Not sure if this is an fault or expected behaviour, but if I send this query:

{
    "find": {
        "sort": 
            {
                "comment_vector": [0.45, 0.09, 0.01, 0.2, 0.11]
            },
            "options" : { "limit" : 1}
    }
}

I get this back, and it has a warning that no filtering was used. Which is true, but we had an ANN sort. It may be better if we had a specific warning about ANN sort with no filter ? We need to decide before changing.

{
    "data": {
        "documents": [
            {
                "comment_vector": [
                    0.45,
                    0.09,
                    0.01,
                    0.2,
                    0.11
                ],
                "comment": "comment about cheese and monkeys",
                "key": "doc 1"
            }
        ],
        "nextPageState": null
    },
    "status": {
        "warnings": [
            {
                "errorCode": "ZERO_FILTER_OPERATIONS",
                "message": "Zero filters were provided in the filer for this query. \n\nProviding zero filters will return all rows in the table, which may have poor performance when the table is large. For the best performance, include one or more filters using the primary key or indexes.\n\nThe table demo.vector_5 has the primary key: key(text).\nAnd has indexes on the columns: comment_vector.\n\nThe query was executed without taking advantage of the primary key or indexes on the table, this can have performance implications on large tables.\n\nSee documentation at XXXX for best practices for filtering.",
                "family": "REQUEST",
                "scope": "WARNING",
                "title": "Zero operations provided in query filter",
                "id": "0502d938-5746-41e6-bd23-20ca1bbef548"
            }
        ],
        "projectionSchema": {
            "comment_vector": {
                "type": "vector",
                "dimension": 5
            },
            "comment": {
                "type": "text"
            },
            "key": {
                "type": "text"
            }
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant