Skip to content

Commit 5e7312d

Browse files
rhoulihanclaude
andcommitted
labs: reconcile modules 02+03 on main — transactional search index moves to subject
The documented merge-time collision (article 3 header MERGE NOTE): a SEARCH index and the HVI's text component are the same indextype and cannot share the body column (ORA-29879), and the HVI's text component does NOT sync on commit (verified empirically 2026-07-24 — a committed probe row was not CONTAINS-findable through the HVI). So on main: - 05-text-vector: ticket_text_idx (SYNC ON COMMIT) now indexes SUBJECT - 09-hybrid-index: drop of ticket_text_idx removed — HVI owns body, no collision - module 02 proof 3: marker token moves to the subject; CONTAINS(subject, ...) (the article/02 branch keeps the published body-marker form) - READMEs: index table + module map updated (module 03 on main, 23 assertions) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent db35af5 commit 5e7312d

5 files changed

Lines changed: 52 additions & 35 deletions

File tree

labs/converged-database-lab/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ All modules run against one deterministically seeded domain. Seeds use an LCG (s
8080
| `idx_orders_customer` | B-tree | Customer order range scans |
8181
| `idx_items_product` | B-tree | Product-level aggregations |
8282
| `idx_tickets_customer` | B-tree | Per-customer ticket lookups |
83-
| `ticket_text_idx` | Oracle Text (SEARCH INDEX) | Full-text keyword search on ticket bodies |
84-
| `ticket_vec_idx` | Vector IVF (NEIGHBOR PARTITIONS, COSINE) | Approximate nearest-neighbor on embeddings |
83+
| `ticket_text_idx` | Oracle Text (SEARCH INDEX, SYNC ON COMMIT) | Transactional keyword search on ticket subjects (module 02's read-after-write proof; body text search belongs to the HVI) |
84+
| `ticket_vec_idx` | Vector IVF (NEIGHBOR PARTITIONS, COSINE) | Approximate nearest-neighbor on 8-dim demo embeddings |
85+
| `tickets_bodyvec_ivf` | Vector IVF (NEIGHBOR PARTITIONS, COSINE) | ANN on the real 384-dim `body_vec` embeddings (module 03) |
86+
| `tickets_hvi` | Hybrid Vector Index (Text + vector, one domain index) | Fused keyword + semantic search on ticket bodies (module 03) |
8587

8688
**Note on embeddings:** The 8-dim vectors are deterministic demo values generated by the LCG seed. All engine behaviors demonstrated (distance functions, vector indexes, transactions, cross-model joins) are dimension-independent. Module 03 documents the optional real-model flow using `DBMS_VECTOR.LOAD_ONNX_MODEL` with all-MiniLM-L12-v2.
8789

@@ -95,7 +97,7 @@ All modules run against one deterministically seeded domain. Seeds use an LCG (s
9597
|---|------|--------|--------|------------|-------|
9698
| 01 | `what-is-a-converged-database` | Live | 5 | 20 | [README](modules/01-what-is-a-converged-database/README.md) · [article](https://blogs.oracle.com/developers/what-is-a-converged-database-definition-five-tests-and-ai-use-cases) |
9799
| 02 | `converged-vs-multi-model` | Live | 3 | 18 | [README](modules/02-converged-vs-multi-model/README.md) · [article](https://blogs.oracle.com/developers/converged-database-vs-multi-model-database-whats-the-difference) |
98-
| 03 | `vector-vs-converged` | On branch, CI-green — article in draft | 4 | 19 | [README](https://github.com/oracle-devrel/oracle-umt-developer-hub/blob/article/03-vector-vs-converged/labs/converged-database-lab/modules/03-vector-vs-converged/README.md) · [branch](https://github.com/oracle-devrel/oracle-umt-developer-hub/tree/article/03-vector-vs-converged) · article at publish |
100+
| 03 | `vector-vs-converged` | On main, validated — article in draft | 4 | 23 | [README](modules/03-vector-vs-converged/README.md) · [branch](https://github.com/oracle-devrel/oracle-umt-developer-hub/tree/article/03-vector-vs-converged) · article at publish |
99101
| 04 | `ai-agents-enterprise-data` | On branch, CI-green — article in draft | 3 | 16 | [README](https://github.com/oracle-devrel/oracle-umt-developer-hub/blob/article/04-ai-agents-enterprise-data/labs/converged-database-lab/modules/04-ai-agents-enterprise-data/README.md) · [branch](https://github.com/oracle-devrel/oracle-umt-developer-hub/tree/article/04-ai-agents-enterprise-data) · article at publish |
100102
| 05 | `json-graph-vector-relational` | On branch, CI-green — article in draft | 4 | 26 | [README](https://github.com/oracle-devrel/oracle-umt-developer-hub/blob/article/05-json-graph-vector-relational/labs/converged-database-lab/modules/05-json-graph-vector-relational/README.md) · [branch](https://github.com/oracle-devrel/oracle-umt-developer-hub/tree/article/05-json-graph-vector-relational) · article at publish |
101103
| 06 | `secure-agent-access` | On branch, CI-green — article in draft | 4 | 7 | [README](https://github.com/oracle-devrel/oracle-umt-developer-hub/blob/article/06-secure-agent-access/labs/converged-database-lab/modules/06-secure-agent-access/README.md) · [branch](https://github.com/oracle-devrel/oracle-umt-developer-hub/tree/article/06-secure-agent-access) · article at publish |

labs/converged-database-lab/docker/init/05-text-vector.sql

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
ALTER SESSION SET CONTAINER = FREEPDB1;
22
ALTER SESSION SET CURRENT_SCHEMA = lab_user;
33

4-
-- Oracle Text index on ticket bodies: keyword search in the same engine/transaction.
5-
-- SYNC (ON COMMIT): the index syncs inside the committing transaction, so a
6-
-- committed row is immediately findable via CONTAINS — transactional
7-
-- read-after-write search (module 02 proves this). The 26ai Free default for
8-
-- CREATE SEARCH INDEX is MAINTENANCE AUTO with deferred background sync
9-
-- (ctx_user_indexes showed IDX_SYNC_TYPE = MANUAL), under which a probe row was
10-
-- NOT visible to CONTAINS immediately after COMMIT.
11-
CREATE SEARCH INDEX ticket_text_idx ON support_tickets (body)
4+
-- Oracle Text index on ticket SUBJECTS: keyword search in the same
5+
-- engine/transaction. SYNC (ON COMMIT): the index syncs inside the committing
6+
-- transaction, so a committed row is immediately findable via CONTAINS —
7+
-- transactional read-after-write search (module 02 proves this). The 26ai Free
8+
-- default for CREATE SEARCH INDEX is MAINTENANCE AUTO with deferred background
9+
-- sync (ctx_user_indexes showed IDX_SYNC_TYPE = MANUAL), under which a probe
10+
-- row was NOT visible to CONTAINS immediately after COMMIT.
11+
--
12+
-- MERGE RECONCILIATION (modules 02 + 03 together on main): this index lives on
13+
-- SUBJECT here, not BODY. Module 03's Hybrid Vector Index owns body text search
14+
-- (an HVI's text component is the same indextype as a SEARCH index — two cannot
15+
-- share a column, ORA-29879), and the HVI's text component does NOT sync on
16+
-- commit (verified empirically 2026-07-24: a committed probe row was not
17+
-- CONTAINS-findable through the HVI). Module 02's read-after-write proof
18+
-- therefore probes the subject column on main; the article/02 BRANCH keeps the
19+
-- body form that the published article's snippets byte-match.
20+
CREATE SEARCH INDEX ticket_text_idx ON support_tickets (subject)
1221
PARAMETERS ('SYNC (ON COMMIT)');
1322

1423
-- Vector index. IVF (NEIGHBOR PARTITIONS) — works within Free-tier memory without

labs/converged-database-lab/docker/init/09-hybrid-index.sql

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,23 @@ ALTER SESSION SET CURRENT_SCHEMA = lab_user;
77
-- Leaf-3-specific: the foundational model + body_vec + IVF live in 08 (on main);
88
-- this HVI is the article-3 hybrid-search showcase and stays on this branch.
99
--
10-
-- COLLISION NOTE: a CONTEXT/SEARCH text index and the HVI's internal text
11-
-- component are the SAME indextype, so two cannot sit on the same column
12-
-- (ORA-29879). The shared 05-text-vector.sql creates ticket_text_idx (a SEARCH
13-
-- index) on body; this module needs the richer body text for a meaningful hybrid
14-
-- proof, so we DROP ticket_text_idx here and let the HVI own body's text search.
15-
-- The HVI exposes the same CONTAINS(body, ...) capability, so keyword-only search
16-
-- still works. (On the eventual merge with the module-02 branch, whose
17-
-- read-after-write SEARCH proof uses ticket_text_idx, that proof moves to the HVI
18-
-- or to the subject column — a merge-time decision.)
10+
-- COLLISION NOTE — RESOLVED ON MAIN: a CONTEXT/SEARCH text index and the HVI's
11+
-- internal text component are the SAME indextype, so two cannot sit on the same
12+
-- column (ORA-29879). On main, 05-text-vector.sql creates ticket_text_idx on
13+
-- SUBJECT (SYNC ON COMMIT, for module 02's transactional read-after-write
14+
-- proof) and this HVI owns BODY text search (module 03's hybrid proof) —
15+
-- different columns, no collision, so the branch-era ticket_text_idx drop is
16+
-- gone. The HVI's text component does NOT sync on commit (verified 2026-07-24),
17+
-- which is why module 02's proof cannot ride on the HVI.
1918
--
2019
-- VECTOR_IDXTYPE IVF keeps the HVI's vector component off the Vector Pool
2120
-- (Free-safe); MEMORY 256M caps the Oracle Text build memory modestly. Builds in
22-
-- ~6s on the Free container.
21+
-- a few minutes over the 10,000-ticket corpus on the Free container.
2322
DECLARE
2423
BEGIN
2524
EXECUTE IMMEDIATE 'DROP INDEX tickets_hvi';
2625
EXCEPTION WHEN OTHERS THEN NULL; /* absent — first run */
2726
END;
2827
/
29-
DECLARE
30-
BEGIN
31-
EXECUTE IMMEDIATE 'DROP INDEX ticket_text_idx';
32-
EXCEPTION WHEN OTHERS THEN NULL; /* HVI takes over body text search */
33-
END;
34-
/
3528
CREATE HYBRID VECTOR INDEX tickets_hvi ON support_tickets(body)
3629
PARAMETERS('MODEL MINILM_L12 VECTOR_IDXTYPE IVF MEMORY 256M');

labs/converged-database-lab/modules/02-converged-vs-multi-model/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,12 @@ immediately does not. Search visibility arrives with the commit, in the same
9292
engine, with no separate search process, change stream, or refresh interval.
9393
The lab's `ticket_text_idx` is created with `PARAMETERS ('SYNC (ON COMMIT)')`
9494
(`docker/init/05-text-vector.sql`), so the text index syncs inside the
95-
committing transaction.
95+
committing transaction. On main, this index lives on the ticket **subject**
96+
(the marker token travels in the subject accordingly): module 03's Hybrid
97+
Vector Index owns body text search, and an HVI's text component does not sync
98+
on commit — the transactional read-after-write property this proof
99+
demonstrates needs the dedicated SYNC(ON COMMIT) index. The article/02 branch
100+
keeps the body-marker form that the published article's snippets byte-match.
96101

97102
**Commit exception:** this script intentionally COMMITs (read-after-write can
98103
only be shown across a real commit boundary), so the harness rollback does not

labs/converged-database-lab/modules/02-converged-vs-multi-model/scripts/03-read-after-write-search.sql

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ DELETE /* Module 02 proof 3: transactional read-after-write text search.
77
syncs inside the committing transaction, so search visibility arrives WITH
88
the commit, not eventually after it.
99
10+
MAIN-BRANCH RECONCILIATION: on main the SYNC(ON COMMIT) search index lives
11+
on SUBJECT (module 03's Hybrid Vector Index owns body text search, and the
12+
HVI's text component does not sync on commit — verified 2026-07-24), so
13+
this proof carries its marker token in the subject and probes
14+
CONTAINS(subject, ...). The article/02 branch keeps the body-marker form
15+
that the published article's snippets byte-match; the property proven —
16+
search visibility inside the committing transaction — is identical.
17+
1018
COMMIT WARNING: this script intentionally COMMITs — a documented exception
1119
to the rollback contract (see the module README). Read-after-write through
1220
a text index can only be demonstrated across a real commit boundary.
@@ -17,32 +25,32 @@ DELETE /* Module 02 proof 3: transactional read-after-write text search.
1725
1826
This first statement is an idempotence guard: remove any probe rows left by
1927
a previously interrupted run (committed together with the INSERT below). */
20-
FROM support_tickets WHERE subject = 'm02 rw-search probe';
28+
FROM support_tickets WHERE subject LIKE 'm02 rw-search probe%';
2129

2230
INSERT INTO support_tickets (customer_id, subject, body, status)
23-
VALUES (1, 'm02 rw-search probe',
24-
'read-after-write search probe, marker token zzqxw9347', 'open');
31+
VALUES (1, 'm02 rw-search probe zzqxw9347',
32+
'read-after-write search probe (marker token in subject)', 'open');
2533

2634
COMMIT;
2735

2836
SELECT /* the committed row is findable by CONTAINS immediately — same call
2937
stack, same second, no sync window */
3038
'ASSERT:contains-finds-committed-write:' ||
3139
CASE WHEN COUNT(*) = 1 THEN 'PASS' ELSE 'FAIL' END
32-
FROM support_tickets WHERE CONTAINS(body, 'zzqxw9347') > 0;
40+
FROM support_tickets WHERE CONTAINS(subject, 'zzqxw9347') > 0;
3341

3442
DELETE /* explicit cleanup: remove the probe ticket */
35-
FROM support_tickets WHERE subject = 'm02 rw-search probe';
43+
FROM support_tickets WHERE subject LIKE 'm02 rw-search probe%';
3644

3745
COMMIT;
3846

3947
SELECT /* and the committed delete is just as immediately invisible to
4048
search — read-after-write holds in both directions */
4149
'ASSERT:contains-after-cleanup:' ||
4250
CASE WHEN COUNT(*) = 0 THEN 'PASS' ELSE 'FAIL' END
43-
FROM support_tickets WHERE CONTAINS(body, 'zzqxw9347') > 0;
51+
FROM support_tickets WHERE CONTAINS(subject, 'zzqxw9347') > 0;
4452

4553
SELECT /* domain restored: no probe rows survive in the base table either */
4654
'ASSERT:probe-rows-gone:' ||
4755
CASE WHEN COUNT(*) = 0 THEN 'PASS' ELSE 'FAIL' END
48-
FROM support_tickets WHERE subject = 'm02 rw-search probe';
56+
FROM support_tickets WHERE subject LIKE 'm02 rw-search probe%';

0 commit comments

Comments
 (0)