Comments (4)
hi @herenow
yes, we currently have do not support limit on update and delete
see https://crate.io/docs/current/sql/reference/delete.html and https://crate.io/docs/current/sql/reference/update.html
can you tell me about the use-case you have to update delete with limit. we put this on our backlog - in order to prioritize this feature, it would be nice to hear such use-cases
thx, bernd
from crate.
Hi @dobe,
Just let me get something straight first, how does Crate know when to stop deleting or updating? If its searching with a 'primary key' it will by default stop matching once it has found one match? If its a normal search based on a normal index 'key' it will keep iterating the table until it has found all matches?
Sorry if I got the process wrong, i'm not sure how DB's generally work and match data. But as a developer, I generally put LIMIT's on my UPDATE's and DELETE's for performance reasons, considering if I don't the DB will keep trying to find more then one match.
from crate.
In crate, it is actually more work to apply a limit than without. This is due to the distributed nature of crate. A table is distributed across multiply shards from which all matching docs are updated or deleted. Implementing a limit clause would require some effort in order to not update/delete too many rows, since we cannot limit just by the value of the specified limit, because in the worst case it would delete num_shards*limit number of documents instead of just the specified limit.
However since this is only for performance - you don't need to specify the limit. I also think that for most databases this makes no difference in speed.
Actually, if crate sees that a full primary key is specified in the query part, the planner internally does a direct update of the row instead of a query automatically.
from crate.
Got it, thanks.
from crate.
Related Issues (20)
- Eligible filters are not pushed down if any are ineligible, resulting in none being pushed down HOT 3
- Implement position(substring in string)
- Unexpected result when using escape character in `LIKE` HOT 2
- Cast to geo_shape not working on generated column HOT 2
- NPE on `MIN` aggregation on a mixed-version cluster 5.8.0/5.7.3 HOT 1
- Alternating exceptions/results with geo_shape UDF and MATCH USING WITHIN
- Enable logging in ECS JSON format
- Allow users with `AL` privileges to manage session settings defaults for other users HOT 1
- `COUNT()` from a nested view should use `COUNT` operator instead of `COLLECT`
- StaticInformationSchemaQueryTest.testIsNotNull test failure HOT 2
- Success `statusCode` for failed bulk inserts with HTTP endpoint HOT 1
- Extra flags to provide further details on failed records on HTTP endpoint bulk insertion HOT 1
- Improve `ARRAY_LENGTH` performance for arrays within object arrays HOT 1
- Improve performance in HyperLogLogDistinctAggregation
- Invalid results when filtering with `ARRAY_LENGTH` on an array in array of objects HOT 2
- IndexOutOfBoundsException on query with ORDER BY in 3 nodes cluster HOT 3
- ShardInfo in NodeInfo MXBean is missing the schema name leading to duplicates HOT 4
- Table with dynamic column policy is silently failing first insert if it includes an empty array HOT 5
- Unexpected result when using empty `OBJECT` literal HOT 2
- Behaviour of numeric scale and casting inconsistent / unspecified HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crate.