update json_query documentation for new join syntax
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Medium
|
Unassigned | ||
3.0 |
Won't Fix
|
Medium
|
Unassigned | ||
3.1 |
Fix Released
|
Medium
|
Unassigned | ||
3.2 |
Fix Released
|
Medium
|
Unassigned |
Bug Description
The patch for bug 1527731 taught json_query how to specify that tables to joined in a particular order. From the commit message:
With this commit we now support user-defined join order in cstore and friends.
Previously, because the join structure of oils_sql beyond the specification of
a single table was only allowed to be represented as a JSON object, it was
subject to potential hash key reordering -- thanks, Perl. By supporting an
intervening array layer, one can now specify the exact join order of the
tables in a join tree.
For example, given the following JSON object passing through a modern Perl 5
interpreter as a nested hash:
{select : {acp:['id'],
},
from : {acp:
}
}
the FROM clause of the query may end up as:
FROM acp
JOIN acn ON (acp.call_number = acn.id AND acn.record = 12345)
JOIN acpl ON (acp.location = acpl.id)
Or as:
FROM acp
JOIN acpl ON (acp.location = acpl.id)
JOIN acn ON (acp.call_number = acn.id AND acn.record = 12345)
In some situations, the join order will matter either to the semantics of the
query plan, or to its performance. The following example of the newly
supported syntax illustrates how to specify join order:
{select : {acp:['id'],
},
from : {acp:[
]}
}
And the only FROM clause the can be generated is:
FROM acp
JOIN acn ON (acp.call_number = acn.id AND acn.record = 12345)
JOIN acpl ON (acp.location = acpl.id)
Technical documentation that should be updated includes docs/TechRef/
tags: | added: documentation |
Changed in evergreen: | |
milestone: | none → 3.0.2 |
importance: | Undecided → Medium |
Changed in evergreen: | |
milestone: | 3.0.2 → 3.0.3 |
Changed in evergreen: | |
milestone: | 3.0.3 → 3.0.4 |
Changed in evergreen: | |
milestone: | 3.0.4 → 3.05 |
Changed in evergreen: | |
milestone: | 3.0.5 → 3.0.6 |
Changed in evergreen: | |
milestone: | 3.0.6 → 3.0.7 |
Changed in evergreen: | |
milestone: | 3.0.7 → 3.0.8 |
Changed in evergreen: | |
milestone: | 3.0.8 → 3.1.3 |
Changed in evergreen: | |
milestone: | 3.1.3 → 3.1.4 |
Changed in evergreen: | |
milestone: | 3.1.4 → 3.1.5 |
Changed in evergreen: | |
milestone: | 3.1.5 → 3.1.6 |
Changed in evergreen: | |
milestone: | 3.1.6 → 3.2.1 |
Changed in evergreen: | |
milestone: | 3.2.1 → 3.2.2 |
tags: | added: pullrequest |
Changed in evergreen: | |
milestone: | 3.2.2 → 3.2.3 |
Changed in evergreen: | |
milestone: | 3.2.3 → 3.3-beta1 |
status: | Fix Committed → Fix Released |
Changed in evergreen: | |
status: | Fix Released → Fix Committed |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
We should also update the wiki page (or make a plan for removing one of them, so there's a single source):
https:/ /wiki.evergreen -ils.org/ doku.php? id=documentatio n:tutorials: json_query