The SET_ATTRIBUTE procedure is used to set auto-rebuild related attributes for a specified vector index, including parallelism, trigger threshold, and trigger interval.
Syntax
PROCEDURE SET_ATTRIBUTE(
IN idx_name VARCHAR(65535),
IN table_name VARCHAR(65535),
IN attribute_name VARCHAR(65535),
IN attribute_value VARCHAR(65535));
Parameters
Parameter |
Description |
Required |
|---|---|---|
| idx_name | The name of the vector index. | Required |
| table_name | The name of the table where the index resides. | Required |
| attribute_name | The name of the attribute. | Required |
| attribute_value | The attribute value, passed in as a string. | Required |
Supported attributes
attribute_name |
Description |
Example of attribute_value |
|---|---|---|
parallel |
The parallelism of auto-rebuild. | '20' |
rebuild_trigger_percentage |
The trigger threshold for auto-rebuild, representing the ratio of incremental data to baseline data. The value range is [0, 1]. The default value is 0.2 (20%). |
'0.5' |
rebuild_repeat_interval |
The check/trigger interval for auto-rebuild. The syntax is similar to the Scheduler's REPEAT_INTERVAL. |
'FREQ=SECONDLY; INTERVAL=600', 'FREQ=DAILY; byhour=19;byminute=45;bysecond=0' |
Examples
-- Set the rebuild parallelism
CALL DBMS_VECTOR.SET_ATTRIBUTE('idx1', 't1', 'parallel', '4');
-- Set the rebuild trigger threshold (triggered when incremental data reaches 50% of the baseline)
CALL DBMS_VECTOR.SET_ATTRIBUTE('idx1', 't1', 'rebuild_trigger_percentage', '0.5');
-- Set the rebuild trigger interval: check every 600 seconds
CALL DBMS_VECTOR.SET_ATTRIBUTE('idx1', 't1', 'rebuild_repeat_interval', 'FREQ=SECONDLY; INTERVAL=600');
-- Set the rebuild trigger interval: check at 19:45:00 every day
CALL DBMS_VECTOR.SET_ATTRIBUTE('idx1', 't1', 'rebuild_repeat_interval', 'FREQ=DAILY; byhour=19;byminute=45;bysecond=0');
Constraints
- After a version upgrade, you must manually execute the following statement in the sys tenant to make the newly added
DBMS_VECTORPL syntax take effect:ALTER SYSTEM RUN UPGRADE JOB 'upgrade_all'; - Manual rebuild overrides parallelism: If
parallelhas been set toathroughSET_ATTRIBUTE, and thenDBMS_VECTOR.REBUILD_INDEX(..., parallel=b)is manually executed, this rebuild uses parallelismb, and theparallelattribute recorded on the index is eventually updated tob.
