-
Notifications
You must be signed in to change notification settings - Fork 550
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
PRIMARY KEY lookup with additional filters #10298
Comments
Yes, if there are no |
So I guess that is ok, since we can rely on |
I think that should also work, problematic is a |
If filters are combined by AND operators in addition to filters on primary key columns, the optimzed PK lookup plan is used now. Closes #10298.
If filters are combined by AND operators in addition to filters on primary key columns, the optimized PK lookup plan is used now. Closes #10298.
If filters are combined by AND operators in addition to filters on primary key columns, the optimized PK lookup plan is used now. Closes #10298.
If filters are combined by AND operators in addition to filters on primary key columns, the optimized PK lookup plan is used now. Closes #10298.
If filters are combined by AND operators in addition to filters on primary key columns, the optimized PK lookup plan is used now. Closes #10298.
If filters are combined by AND operators in addition to filters on primary key columns, the optimized PK lookup plan is used now. Closes #10298.
Use case:
The SQLAlchemy ORM loads expired session objects by their primary key identity:
Since documents in CrateDB are immediately available through PK lookup, this works great. So far so good.
However, we have the case that a bunch of SQLAlchemy models have an
deleted
field, which defines whether the object is "visible". In order to transparently hide thedeleted = FALSE
filter from queries, we make use of the pattern described here: https://docs.sqlalchemy.org/en/13/orm/events.html#sqlalchemy.orm.events.QueryEvents.before_compileCompiling the query for loading on primary key identity however, is also going through this event hook, causing the alleged primary key lookups to be converted to regular search queries. These search queries then of course do not find the object with the given primary key.
Example:
Feature description:
Would it somehow be possible to make use of primary key lookups if a query contains the full primary key even if there are additional filters? CrateDB should be able to find the document immediately, right?
The text was updated successfully, but these errors were encountered: