Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
b846a8d0
Commit
b846a8d0
authored
9 years ago
by
ocelot-inc
Browse files
Options
Downloads
Patches
Plain Diff
box_index.rst, shard.rst, tarantool.rst
parent
b0eea2c7
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/sphinx/book/box/box_index.rst
+8
-8
8 additions, 8 deletions
doc/sphinx/book/box/box_index.rst
doc/sphinx/reference/shard.rst
+1
-1
1 addition, 1 deletion
doc/sphinx/reference/shard.rst
doc/sphinx/reference/tarantool.rst
+4
-3
4 additions, 3 deletions
doc/sphinx/reference/tarantool.rst
with
13 additions
and
12 deletions
doc/sphinx/book/box/box_index.rst
+
8
−
8
View file @
b846a8d0
...
...
@@ -636,9 +636,9 @@ is Rectangle#2", and "Rectangle#3 is entirely inside Rectangle#2".
Now let us create a space and add an RTREE index.
:codebold:`s = box.schema.create_space`
:codebold:`i = s:create_index('primary',{type='HASH',parts={1,'NUM'}})`
:codebold:`r = s:create_index('spatial',{type='RTREE',unique=false,parts={2,'ARRAY'}})`
|
:codebold:`s = box.schema.create_space
('rectangles')
`
|
:codebold:`i = s:create_index('primary',{type='HASH',parts={1,'NUM'}})`
|
:codebold:`r = s:create_index('spatial',{type='RTREE',unique=false,parts={2,'ARRAY'}})`
Field#1 doesn't matter, we just make it because we need a primary-key index.
(RTREE indexes cannot be unique and therefore cannot be primary-key indexes.)
...
...
@@ -646,17 +646,17 @@ The second field must be an "array", which means its values must represent
{x,y} points or {x1,y1,x2,y2} rectangles. Now let us populate the table by
inserting two tuples, containing the coordinates of Rectangle#2 and Rectangle#4.
:codebold:`s:insert{1, {3,5,9,10}}`
:codebold:`s:insert{2, {10,11}}`
|
:codebold:`s:insert{1, {3,5,9,10}}`
|
:codebold:`s:insert{2, {10,11}}`
And now, following the description of `RTREE iterator types`_, we can search the
rectangles with these requests:
.. _RTREE iterator types: rtree-iterator_
:codebold:`r:select({10,11,10,11},{iterator='EQ'}) -- Request#1 (returns 1 tuple)`
:codebold:`r:select({4,7,5,9},{iterator='GT'}) -- Request#2 (returns 1 tuple)`
:codebold:`r:select({1,2,3,4},{iterator='NEIGHBOR'}) -- Request#3 (returns 2 tuples)`
|
:codebold:`r:select({10,11,10,11},{iterator='EQ'}) -- Request#1 (returns 1 tuple)`
|
:codebold:`r:select({4,7,5,9},{iterator='GT'}) -- Request#2 (returns 1 tuple)`
|
:codebold:`r:select({1,2,3,4},{iterator='NEIGHBOR'}) -- Request#3 (returns 2 tuples)`
Request#1 returns 1 tuple because the point {10,11} is the same as the rectangle
{10,11,10,11} ("Rectangle#4" in the picture). Request#2 returns 1 tuple because
...
...
This diff is collapsed.
Click to expand it.
doc/sphinx/reference/shard.rst
+
1
−
1
View file @
b846a8d0
...
...
@@ -19,7 +19,7 @@ The shard package distributes according to a hash algorithm,
that is, it applies a hash function to a tuple's primary-key value
in order to decide which shard the tuple belongs to.
The hash function is `consistent`_
so that changing the number of
tuple
s will not affect results for many keys.
so that changing the number of
server
s will not affect results for many keys.
The specific hash function that the shard package uses is
guava.digest in the :codeitalic:`digest` package. |br|
**Queue** ...
...
...
This diff is collapsed.
Click to expand it.
doc/sphinx/reference/tarantool.rst
+
4
−
3
View file @
b846a8d0
...
...
@@ -8,9 +8,10 @@ By saying :code:`require('tarantool')`, one can answer
some questions about how the tarantool server was built,
such as "what flags were used", or "what was the version
of the compiler". Additionally one can see the uptime
and the server version and the process id, but those
information items are more commonly accessed with
:func:`box.info`.
and the server version and the process id. Those
information items can also be accessed with
:func:`box.info` but use of the tarantool package is
recommended.
| EXAMPLE
| :codenormal:`tarantool>` :codebold:`tarantool = require('tarantool')`
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment