-
Notifications
You must be signed in to change notification settings - Fork 14
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
It seems that crud is doing two selects in one crud.get
#413
Comments
Initial thoughts based on
See examples below. tarantool> crud.get('customers', 1); print(box.stat()['SELECT']['total'])
257
---
...
tarantool> crud.get('customers', 1); print(box.stat()['SELECT']['total'])
259
---
...
tarantool> crud.get('customers', 1); print(box.stat()['SELECT']['total'])
260
---
...
tarantool> crud.get('customers', 1); print(box.stat()['SELECT']['total'])
261
---
...
tarantool> crud.get('customers', 1); print(box.stat()['SELECT']['total'])
262
---
...
tarantool> crud.get('customers', 1); print(box.stat()['SELECT']['total'])
263
---
...
tarantool> crud.get('customers', 1); print(box.stat()['SELECT']['total'])
264
---
...
tarantool> crud.get('customers', 1); print(box.stat()['SELECT']['total'])
265
---
...
tarantool> crud.get('customers', 1); print(box.stat()['SELECT']['total'])
266
---
...
tarantool> print(box.stat()['SELECT']['total'])
268
---
... If CRUD not configured. diff --git a/doc/playground.lua b/doc/playground.lua
index d4e547f..e42720b 100755
--- a/doc/playground.lua
+++ b/doc/playground.lua
@@ -146,8 +146,8 @@ box.once('developers', function()
end)
-- Initialize crud.
-crud.init_storage()
-crud.init_router()
+-- crud.init_storage()
+-- crud.init_router()
-- Start a console.
console.start() tarantool> vshard.router.callrw(1, 'box.space.customers:get', {1}); print(box.stat()['SELECT']['total'])
185
---
...
tarantool> vshard.router.callrw(1, 'box.space.customers:get', {1}); print(box.stat()['SELECT']['total'])
188
---
...
tarantool> vshard.router.callrw(1, 'box.space.customers:get', {1}); print(box.stat()['SELECT']['total'])
190
---
...
tarantool> vshard.router.callrw(1, 'box.space.customers:get', {1}); print(box.stat()['SELECT']['total'])
192
---
...
tarantool> vshard.router.callrw(1, 'box.space.customers:get', {1}); print(box.stat()['SELECT']['total'])
194
---
... |
I noticed that for each crud replace in the metrics on the master, 1 select and 1 replace are added. It seems that this is the same select as in the get request. I use the same query: crud.MakeReplaceObjectRequest("users").Object(crud.MapObject{
"token": uuid.NewString(),
"user_id": uuid.NewString(),
}) |
I call crud.get via go-tarantool using the primary key in this way:
client.Do(crud.MakeGetRequest("users").Key([]any{reqUser.Token}), pool.ANY)
As a result, I look at the
tnt_stats_op_total
metric and see that one call and two selects are made on storage, which is strange. It seems that there should be one select, since this is a point query based on the primary keyThe text was updated successfully, but these errors were encountered: