Skip to content

Commit 0a2b15e

Browse files
committed
Deploying to master from @ JanusGraph/janusgraph@213b754 🚀
1 parent 465078a commit 0a2b15e

11 files changed

Lines changed: 174 additions & 40 deletions

File tree

master/changelog/index.html

Lines changed: 96 additions & 39 deletions
Large diffs are not rendered by default.

master/schema/index-management/index-performance/index.html

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,26 @@
908908
Label Constraint
909909
</a>
910910

911+
</li>
912+
913+
<li class="md-nav__item">
914+
<a href="#inlining-vertex-properties-into-a-composite-index" class="md-nav__link">
915+
Inlining vertex properties into a Composite Index
916+
</a>
917+
918+
<nav class="md-nav" aria-label="Inlining vertex properties into a Composite Index">
919+
<ul class="md-nav__list">
920+
921+
<li class="md-nav__item">
922+
<a href="#usage" class="md-nav__link">
923+
Usage
924+
</a>
925+
926+
</li>
927+
928+
</ul>
929+
</nav>
930+
911931
</li>
912932

913933
<li class="md-nav__item">
@@ -2161,6 +2181,26 @@
21612181
Label Constraint
21622182
</a>
21632183

2184+
</li>
2185+
2186+
<li class="md-nav__item">
2187+
<a href="#inlining-vertex-properties-into-a-composite-index" class="md-nav__link">
2188+
Inlining vertex properties into a Composite Index
2189+
</a>
2190+
2191+
<nav class="md-nav" aria-label="Inlining vertex properties into a Composite Index">
2192+
<ul class="md-nav__list">
2193+
2194+
<li class="md-nav__item">
2195+
<a href="#usage" class="md-nav__link">
2196+
Usage
2197+
</a>
2198+
2199+
</li>
2200+
2201+
</ul>
2202+
</nav>
2203+
21642204
</li>
21652205

21662206
<li class="md-nav__item">
@@ -2523,6 +2563,43 @@ <h3 id="label-constraint">Label Constraint</h3>
25232563
index with label restriction is defined as unique, the uniqueness
25242564
constraint only applies to properties on vertices or edges for the
25252565
specified label.</p>
2566+
<h3 id="inlining-vertex-properties-into-a-composite-index">Inlining vertex properties into a Composite Index</h3>
2567+
<p>Inlining vertex properties into a Composite Index structure can offer significant performance and efficiency benefits.</p>
2568+
<ol>
2569+
<li>
2570+
<p><strong>Performance Improvements</strong>
2571+
Faster Querying: Inlining vertex properties directly within the index allows the search engine to retrieve all relevant data from the index itself.
2572+
This means, queries don’t need to make additional calls to data stores to fetch full vertex information, significantly reducing lookup time.</p>
2573+
</li>
2574+
<li>
2575+
<p><strong>Data Locality</strong>
2576+
In distributed storages, having inlined properties ensures that more complete data exists within individual partitions or shards.
2577+
This reduces cross-node network calls and improves the overall query performance by ensuring data is more local to the request being processed.</p>
2578+
</li>
2579+
<li>
2580+
<p><strong>Cost of Indexing vs. Storage Trade-off</strong>
2581+
While inlining properties increases the size of the index (potentially leading to more extensive index storage requirements),
2582+
it is often a worthwhile trade-off for performance, mainly when query speed is critical.
2583+
This is a typical pattern in systems optimized for read-heavy workloads.</p>
2584+
</li>
2585+
</ol>
2586+
<h4 id="usage">Usage</h4>
2587+
<p>In order to take advantage of the inlined properties feature, JanusGraph Transaction should be set to use <code>.propertyPrefetching(false)</code></p>
2588+
<p>Example:</p>
2589+
<div class="highlight"><pre><span></span><code><span class="c1">//Build index</span>
2590+
<span class="n">mgmt</span><span class="o">.</span><span class="na">buildIndex</span><span class="o">(</span><span class="s2">&quot;composite&quot;</span><span class="o">,</span><span class="w"> </span><span class="n">Vertex</span><span class="o">.</span><span class="na">class</span><span class="o">)</span>
2591+
<span class="w"> </span><span class="o">.</span><span class="na">addKey</span><span class="o">(</span><span class="n">idKey</span><span class="o">)</span>
2592+
<span class="w"> </span><span class="o">.</span><span class="na">addInlinePropertyKey</span><span class="o">(</span><span class="n">nameKey</span><span class="o">)</span>
2593+
<span class="w"> </span><span class="o">.</span><span class="na">buildCompositeIndex</span><span class="o">()</span>
2594+
<span class="n">mgmt</span><span class="o">.</span><span class="na">commit</span><span class="o">()</span>
2595+
2596+
<span class="c1">//Query</span>
2597+
<span class="n">tx</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">graph</span><span class="o">.</span><span class="na">buildTransaction</span><span class="o">()</span>
2598+
<span class="w"> </span><span class="o">.</span><span class="na">propertyPrefetching</span><span class="o">(</span><span class="kc">false</span><span class="o">)</span><span class="w"> </span><span class="c1">//this is important</span>
2599+
<span class="w"> </span><span class="o">.</span><span class="na">start</span><span class="o">()</span>
2600+
2601+
<span class="n">tx</span><span class="o">.</span><span class="na">traversal</span><span class="o">().</span><span class="na">V</span><span class="o">().</span><span class="na">has</span><span class="o">(</span><span class="s2">&quot;id&quot;</span><span class="o">,</span><span class="w"> </span><span class="mi">100</span><span class="o">).</span><span class="na">next</span><span class="o">().</span><span class="na">value</span><span class="o">(</span><span class="s2">&quot;name&quot;</span><span class="o">)</span>
2602+
</code></pre></div>
25262603
<h3 id="composite-versus-mixed-indexes">Composite versus Mixed Indexes</h3>
25272604
<ol>
25282605
<li>

master/search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

master/sitemap.xml.gz

0 Bytes
Binary file not shown.

sitemap.xml.gz

0 Bytes
Binary file not shown.

v0.2/sitemap.xml.gz

0 Bytes
Binary file not shown.

v0.3/sitemap.xml.gz

0 Bytes
Binary file not shown.

v0.4/sitemap.xml.gz

0 Bytes
Binary file not shown.

v0.5/sitemap.xml.gz

0 Bytes
Binary file not shown.

v0.6/sitemap.xml.gz

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)