@lotics/app-sdk 0.49.0 → 0.49.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/queries.md +20 -11
- package/package.json +1 -1
package/docs/queries.md
CHANGED
|
@@ -763,17 +763,26 @@ slice, and within it:
|
|
|
763
763
|
layer** — `select`/`select_member`/`select_record_link` `has_any_of` / `has_all_of`, and
|
|
764
764
|
`is_current_member`. These compile to containment the JSONB GIN index serves.
|
|
765
765
|
- **Trigram-served:** `from_table.search` (§7).
|
|
766
|
-
- **
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
766
|
+
- **B-tree-served (automatic for deployed queries):** text `equals`, number and date
|
|
767
|
+
comparisons (exact and range), and `sort` fields — for fields referenced in a **deployed
|
|
768
|
+
named query's template**. The platform provisions a partial expression index per referenced
|
|
769
|
+
field automatically: built online on `app deploy` and `app query set`, re-synced daily,
|
|
770
|
+
capped at 8 per table (fields past the cap fall back to the scan tier, with a server WARN).
|
|
771
|
+
A `{{params.…}}` value hole doesn't change this — the field key is static in the template,
|
|
772
|
+
so it still gets its index. Index-seek speed at any table size once provisioned.
|
|
773
|
+
- **Partition scan (linear in table size):** everything else — text `contains`, negations
|
|
774
|
+
(`has_none_of`, `is_none_of`, `not_*`), emptiness, files predicates, and predicates/sorts on
|
|
775
|
+
fields that appear **only** in the runtime `filter`/`sort` options rather than the deployed
|
|
776
|
+
template. Fine on thousands of rows; on very large tables these dominate latency and are the
|
|
777
|
+
usual timeout cause.
|
|
778
|
+
|
|
779
|
+
**Filter shape drives latency.** Equality/range/sort predicates in the deployed template are
|
|
780
|
+
index-served; lead with those or a GIN-served membership filter / `search`, and let scan-shaped
|
|
781
|
+
predicates refine the already-narrowed set. Derived-layer filters run over the subquery result
|
|
782
|
+
(no index), so **filter at the source layer whenever the field exists there** — the runtime
|
|
783
|
+
filter is for caller-driven refinement, not for the main cut (a runtime-only field gets no
|
|
784
|
+
managed index). (The engine pushes eligible filter-over-union predicates down automatically,
|
|
785
|
+
but don't rely on that for other shapes.)
|
|
777
786
|
|
|
778
787
|
### The authoring rules
|
|
779
788
|
|