For information about the tables and views that pgai creates, refer to the pgai documentation.
pgx_vectorizer creates the following tables.
pgx_vectorizer.worker_setting_table table
Stores information about the parameters used by the embedded provider.
Column | Type | Constraint | Description |
|---|---|---|---|
type | text | PRIMARY KEY | The type of parameter to set. The name of the embedded provider or user |
parameter | text | PRIMARY KEY | Parameter name |
value | text | NOT NULL | Value to set for the parameter |
pgx_vectorizer.pgx_fulltext_index table
The pgx_fulltext_index table stores the definition information of the full-text search index created by the pgx_create_vectorizer function.
Column | Type | Reference destination | Description |
|---|---|---|---|
vectorizerid | integer | ai.vectorizer.id | Vectorization identifier |
config | jsonb | Definition information of full-text search index. Configurable values are the return values of the pgx_fulltext_indexing_gin function or the pgx_fulltext_indexing_gist function. |
pgx_vectorizer.pgx_trace_query table
Provides information on hybrid search where trace information is recorded.
When a hybrid search is performed with tracing enabled, one record is inserted.
Deleting records from this table also deletes records from the pgx_trace_subquery table, pgx_trace_results table, and pgx_context_metrics table with the same queryid.
Column | Type | Description |
|---|---|---|
queryid | bigint | Hybrid search ID |
retrieval_time | timestamp with timezone | Time when hybrid search was conducted |
retrieval_user | oid | Database user who performed the hybrid search |
application_name | text | Application name that issued the hybrid search. The value of application_name specified |
query | jsonb | Search criteria for hybrid search |
pgx_vectorizer.pgx_trace_subquery table
Provides information about the subqueries for hybrid searches where trace information is recorded.
When a hybrid search is performed with tracing enabled, multiple records are inserted for each subquery.
Column | Type | Description |
|---|---|---|
queryid | bigint | Hybrid search ID |
subquery_seq | smallint | Serial number of subquery conducted within a hybrid search(A serial number closed in a certain hybrid search process) |
subquery_type | text | Types of subqueries '-' : Overall hybrid search (main query) 'semantic' : Semantic text search 'fulltext' : Full-text search |
subquery_text | text | Content of the executed subquery (SQL statement) |
pgx_vectorizer.pgx_trace_results table
Provides information about the text chunks returned by each search process of hybrid search and subquery.
When performing a hybrid search with trace information enabled, multiple records corresponding to the text chunks of the search results of each subquery are inserted.
Column | Type | Description |
|---|---|---|
queryid | bigint | Hybrid search ID |
subquery_seq | smallint | Serial number of subquery conducted within a hybrid search |
context_id | uuid | Returned text chunk ID |
chunk | text | Returned text chunk |
rank | integer | Rank of text chunks within the same subquery type |
score | real | Score of text chunk. Hybrid search overall : Score calculated by RRF Semantic text search : Score based on distance between vectors in text meaning search Full-text search : Score calculated by score_expression in hybrid search processing |
In the case of text meaning search, the score is calculated using the distance d between the vector representations of the text chunk and the query text, according to the following formula.

pgx_vectorizer.pgx_context_metrics table
This is a list of text chunks returned by either hybrid search or subquery. When the pgx_list_contexts function is executed, records for the specified query ID are inserted. You can enter any evaluation value in the context_metrics column.
Column | Type | Description |
|---|---|---|
queryid | bigint | Hybrid search ID |
context_id | uuid | Returned text chunk ID |
context_metrics | jsonb | You can input evaluation values for text chunks. |
pgx_vectorizer.pgx_trace_contexts view
Provide information about the text chunks returned by either hybrid search or subqueries.
For hybrid searches conducted with trace information enabled, there are records for each text chunk of search results for each subquery.
Column | Type | Description |
|---|---|---|
queryid | bigint | Hybrid search ID |
retrieval_time | timestamp with timezone | Time when hybrid search was conducted |
retrieval_user | oid | Database user who performed the hybrid search |
application_name | text | Application name that issued the hybrid search. The value of application_name specified |
query | jsonb | Search criteria for hybrid search |
subquery_type | text | Types of subqueries '-' : Overall hybrid search (main query) 'semantic' : Semantic text search 'fulltext' : Full-text search |
subquery_text | text | Content of the executed subquery (SQL statement) |
context_id | uuid | Returned text chunk ID |
chunk | text | Returned text chunk |
rank | integer | Rank of text chunks within the same subquery type |
score | real | Score of text chunk. Hybrid search overall : Score calculated by RRF Semantic text search : Score based on distance between vectors in text meaning search Full-text search : Score calculated by score_expression in hybrid search processing |
context_metrics | jsonb | You can input evaluation values for text chunks. |