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
c287e224
Commit
c287e224
authored
12 years ago
by
Dmitry E. Oboukhov
Browse files
Options
Downloads
Patches
Plain Diff
updated documentation
parent
86a08603
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/user/errcode.xml
+8
-0
8 additions, 0 deletions
doc/user/errcode.xml
doc/user/space.xml
+35
-0
35 additions, 0 deletions
doc/user/space.xml
with
43 additions
and
0 deletions
doc/user/errcode.xml
+
8
−
0
View file @
c287e224
...
...
@@ -79,6 +79,14 @@ of existing codes.</para>
<listitem><para>
An error inside Lua procedure.
</para></listitem>
</varlistentry>
<varlistentry>
<term
xml:id=
"ER_INDEX_TRIGGER"
xreflabel=
"ER_INDEX_TRIGGER"
>
ER_INDEX_TRIGGER
</term>
<listitem><para>
An error inside index trigger.
</para></listitem>
</varlistentry>
</variablelist>
</appendix>
...
...
This diff is collapsed.
Click to expand it.
doc/user/space.xml
+
35
−
0
View file @
c287e224
...
...
@@ -34,6 +34,9 @@ struct index_t {
enum index_type type;
/* Secondary index may be non-unique */
bool unique;
/* Secondary index can be partially */
char *where; /* name of lua procedure */
};
struct space_t
...
...
@@ -101,6 +104,38 @@ please be aware of these restrictions:
not be non-unique.
</simpara></listitem>
</itemizedlist>
<bridgehead>
Partial indexes
</bridgehead>
If secondary index has section where, it means that lua procedure
that have the name will be called for each modifying operation.
If the function returns
<emphasis>
true
</emphasis>
the tuple will
be included in the index. Example:
<programlisting
language=
"c"
>
space[0].enabled = 1
space[0].index[1].type = HASH
space[0].index[1].unique = 1
space[0].index[1].where = "my_index_condition"
space[0].index[1].key_field[0].fieldno = 1
space[0].index[1].key_field[0].type = NUM
</programlisting>
<programlisting
language=
"lua"
>
function my_index_condition(tuple)
if tuple[2] == 'abc' then
return true
end
if box.unpack('i', tuple[1]) > 1234 then
return true
end
return false
end
</programlisting>
</para>
<!--
vim: tw=66 syntax=docbk
...
...
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