2 on VECTOR_SEARCH_DEMO( CASE_EMBEDDINGS )
3 organization neighbor partitions
4* distance cosine ;
Vector INDEX created.

2 from user_tables
3* where table_name like 'VECTOR$IVF_DEMO%';
TABLE_NAME
_________________________________________________________________
VECTOR$IVF_DEMO$4040231_4231331_0$IVF_FLAT_CENTROIDS
VECTOR$IVF_DEMO$4040231_4231331_0$IVF_FLAT_CENTROID_PARTITIONS
These tables are of the format:
- VECTOR$<base table name>_IVF_IDX$<object info>$IVF_FLAT_CENTROIDS, containing the list of identified centroid vectors and associated ids.
- VECTOR$<base table name>_IVF_IDX$<object info>$IVF_FLAT_CENTROID_PARTITIONS, which is list-partitioned on the centroid ids. Each partition contains the base table vectors closely related (cluster) to the corresponding centroid id for that partition.
Details of the pool can be displayed by querying the view V$VECTOR_MEMORY_POOL:
POOL ALLOC_BYTES USED_BYTES POPULATE_STATUS CON_ID
____________ ______________ _____________ __________________ _________
1MB POOL 70479593 76546048 OUT OF MEMORY 37
64KB POOL 17619898 1310720 DONE 37
2 , used_bytes, num_vectors, index_dimensions
3 from v$vector_index
4* where index_name ='IVF_DEMO';
INDEX_NAME INDEX_ORGANIZATION ALLOCATED_BYTES USED_BYTES NUM_VECTORS INDEX_DIMENSIONS
_____________ ______________________ __________________ _____________ ______________ ___________________
IVF_DEMO NEIGHBOR PARTITIONS 2097152 80768 1427029 384
2 from (
3 select case_primary_type
4 , case_description
5 , vector_distance(case_embeddings , vector_embedding( MY_DEMO_MODEL using 'LARCENY' as data ) , cosine ) vd
6 from vector_search_demo t
7 order by vd
8 fetch approx first 10 rows only with target accuracy 90 )
9 group by case_primary_type , case_description ,vd
10 order by vd
11* fetch first 15 rows only;
CASE_PRIMARY_TYPE CASE_DESCRIPTION VD
____________________ _________________________________ ______________________
OTHER OFFENSE OTHER CRIME INVOLVING PROPERTY 0.38452393962513975
PLAN_TABLE_OUTPUT
---------------------------------------
SQL_ID 2p9222n5fnzg7, child number 1
-------------------------------------
select case_primary_type , case_description , vd from ( select
case_primary_type , case_description ,
vector_distance(case_embeddings , vector_embedding( MY_DEMO_MODEL using
'LARCENY' as data ) , cosine ) vd from vector_search_demo t order
by vd fetch approx first 10 rows only with target accuracy 90 )
group by case_primary_type , case_description ,vd order by vd fetch
first 15 rows only
Plan hash value: 1724078458
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | Reads |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | | 1 |00:00:00.32 | 4977 | 3 |
| 1 | RESULT CACHE | d2jdkwfk05fmrfw35q2m0zwf4c | 1 | | 1 |00:00:00.32 | 4977 | 3 |
|* 2 | COUNT STOPKEY | | 1 | | 1 |00:00:00.32 | 4977 | 3 |
| 3 | VIEW | | 1 | 10 | 1 |00:00:00.32 | 4977 | 3 |
|* 4 | SORT GROUP BY STOPKEY | | 1 | 10 | 1 |00:00:00.32 | 4977 | 3 |
| 5 | VIEW | | 1 | 10 | 10 |00:00:00.32 | 4977 | 3 |
| 6 | VIEW | | 1 | 10 | 10 |00:00:00.32 | 4977 | 3 |
| 7 | NESTED LOOPS | | 1 | 10 | 10 |00:00:00.32 | 4977 | 3 |
| 8 | VIEW | VW_IVPSR_F17F1C9B | 1 | 10 | 10 |00:00:00.32 | 4962 | 3 |
|* 9 | COUNT STOPKEY | | 1 | | 10 |00:00:00.32 | 4962 | 3 |
| 10 | VIEW | VW_IVPSJ_578B79F1 | 1 | 169K| 10 |00:00:00.32 | 4962 | 3 |
|* 11 | SORT ORDER BY STOPKEY | | 1 | 169K| 10 |00:00:00.32 | 4962 | 3 |
|* 12 | HASH JOIN | | 1 | 169K| 1603 |00:00:00.32 | 4962 | 3 |
| 13 | PART JOIN FILTER CREATE | :BF0000 | 1 | 7 | 7 |00:00:00.22 | 22 | 0 |
| 14 | VIEW | VW_IVCR_B5B87E67 | 1 | 7 | 7 |00:00:00.22 | 22 | 0 |
|* 15 | COUNT STOPKEY | | 1 | | 7 |00:00:00.22 | 22 | 0 |
| 16 | VIEW | VW_IVCN_9A1D2119 | 1 | 59 | 7 |00:00:00.22 | 22 | 0 |
|* 17 | SORT ORDER BY STOPKEY | | 1 | 59 | 7 |00:00:00.22 | 22 | 0 |
| 18 | TABLE ACCESS STORAGE FULL| VECTOR$IVF_DEMO$4040231_4271572_0$IVF_FLAT_CENTROIDS | 1 | 59 | 59 |00:00:00.01 | 22 | 0 |
| 19 | PARTITION LIST JOIN-FILTER | | 1 | 1427K| 1603 |00:00:00.10 | 4940 | 3 |
| 20 | TABLE ACCESS STORAGE FULL | VECTOR$IVF_DEMO$4040231_4271572_0$IVF_FLAT_CENTROID_PARTITIONS | 7 | 1427K| 1603 |00:00:00.10 | 4940 | 3 |
| 21 | TABLE ACCESS BY USER ROWID | VECTOR_SEARCH_DEMO | 10 | 1 | 10 |00:00:00.01 | 15 | 0 |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - filter(ROWNUM<=15)
4 - filter(ROWNUM<=15)
9 - filter(ROWNUM<=10)
11 - filter(ROWNUM<=10)
12 - access("VW_IVCR_B5B87E67"."CENTROID_ID"="VTIX_CNPART"."CENTROID_ID")
15 - filter(ROWNUM<=7)
17 - filter(ROWNUM<=7)
