ROSTAN Technologies
Oracle Trusted Partner  ·  Since 2015
Oracle Trusted Partner
AWS AWS Cloud Partner
Microsoft Partner
1000+ Projects
200+ Clients
20+ Countries
11+ Years
Trusted by 200+ leading enterprises worldwide
oracal
nasscom
automation
newgen
Great Place to Work
Amazon Web Services
Ingram Micro
Microsoft
Zoho
EY
vivo
Titan
uflex
Path infotech
evosys
haldiram
mark-exhaust
Version1
Polycab
Eastcompeace
Deloitte
Quest
Weir
Deepak
USP
BPCL
EPCC
IOTL
AWS Startup Support Program — Free AWS Credits  ·  Apply Now
Loading…

Oracle Database 23ai: Vector Search, JSON Duality Views & AI Vector Index Deep Dive

  • Article By : Rostan Team
  • Jan 24, 2024
  • Share This:

Oracle Database 23ai is not an incremental release — it is a platform shift. Three features in particular deserve a deep technical look: native Vector Search, JSON Relational Duality Views, and the new AI Vector Index type (HNSW and IVF partitioned indexes). Together they eliminate the need for a separate vector database in most enterprise AI stacks.

1. Native Vector Datatype and Storage

The VECTOR datatype stores float32, float64, or int8 arrays of fixed or variable dimension directly in Oracle storage. Unlike storing vectors in a CLOB or RAW column, the native type is index-aware and participates in the cost-based optimiser.

CREATE TABLE product_embeddings (
  product_id   NUMBER PRIMARY KEY,
  description  VARCHAR2(4000),
  embedding    VECTOR(1536, FLOAT32)   -- OpenAI ada-002 dimensions
);

2. HNSW vs IVF — Choosing the Right Index

HNSW (Hierarchical Navigable Small World) is the right choice for datasets under ~5 million vectors where sub-millisecond recall matters. It builds a multi-layer graph and is memory-resident:

CREATE VECTOR INDEX emb_hnsw_idx
ON product_embeddings(embedding)
ORGANIZATION INMEMORY NEIGHBOR GRAPH
DISTANCE COSINE
WITH TARGET ACCURACY 95;

IVF (Inverted File) is better for hundreds of millions of vectors with slower, disk-resident access acceptable:

CREATE VECTOR INDEX emb_ivf_idx
ON product_embeddings(embedding)
ORGANIZATION NEIGHBOR PARTITIONS
DISTANCE DOT;

3. JSON Relational Duality Views

Duality Views are a breakthrough for API development. You define a single JSON document shape that is backed by relational tables — read it as JSON, write it as JSON, but the data stays normalised underneath:

CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW order_dv AS
  SELECT JSON {
    'orderId'  : o.order_id,
    'customer' : c.name,
    'lines'    : [ SELECT JSON { 'sku': l.sku, 'qty': l.qty }
                    FROM   order_lines l WHERE l.order_id = o.order_id ]
  }
  FROM orders o JOIN customers c ON c.id = o.customer_id
  WITH INSERT UPDATE DELETE;

This eliminates the ORM layer for JSON-first microservices while keeping ACID guarantees and SQL analytics on the same data.

4. AI-Assisted SQL (Select AI)

Oracle 23ai ships with Select AI — a natural language to SQL feature powered by LLMs. Configure a profile once:

EXEC DBMS_CLOUD_AI.CREATE_PROFILE(
  profile_name => 'MY_OPENAI',
  attributes   => '{"provider":"openai","model":"gpt-4o","credential_name":"OAI_CRED"}'
);
SELECT AI How many orders were placed in Q1 2025 by enterprise customers?

This is production-safe: the LLM never touches your data, it only generates the SQL which Oracle then validates and executes.

Migration Path from 19c / 21c

Oracle 23ai is compatible at the SQL and PL/SQL level with 19c. The primary upgrade steps are: DBUA in-place or Data Pump export/import, then enable the new features per-schema with ALTER SESSION SET COMPATIBLE=23.0.0. Rostan recommends a lift-and-shift to OCI as the fastest path — provision 23ai on OCI, use GoldenGate for zero-downtime replication, then cut over.


You May Also Know About
Back to Top
ROSTAN Support
Online · Typically replies instantly
WhatsApp Chat directly, fastest response Call Us +91-9810958952 Email Us info@rostantechnologies.com Send a Message Fill the contact form