- Schema:
SEARCH_OPTIMIZATION_HISTORY view¶
This Account Usage view can be used to query the search history. The information returned by the view includes the search optimization service name and credits consumed by the service.
Columns¶
Column Name |
Data Type |
Description |
---|---|---|
START_TIME |
TIMESTAMP_LTZ |
Start of the specified time range. |
END_TIME |
TIMESTAMP_LTZ |
End of the specified time range. |
CREDITS_USED |
TEXT |
Number of credits billed for the search optimization service during the START_TIME and END_TIME window. |
TABLE_ID |
NUMBER |
Internal/system-generated identifier for the search optimization service. |
TABLE_NAME |
TEXT |
This is a system-generated alias that contains the ID of the table for which search optimization was enabled; that ID is embedded inside a string of the form “SEARCH OPTIMIZATION ON TABLE_ID: <optimized_table_id>”. For example, if you enable search optimization on a table named |
SCHEMA_ID |
NUMBER |
Internal/system-generated identifier for the schema that contains the search optimization service. |
SCHEMA_NAME |
TEXT |
Name of the schema that contains the search optimization service. |
DATABASE_ID |
NUMBER |
Internal/system-generated identifier for the database that contains the search optimization service. |
DATABASE_NAME |
TEXT |
Name of the database that contains the search optimization service. |
Usage notes¶
Billing history is not necessarily updated immediately. Latency for the view may be up to 180 minutes (3 hours).
Remember that the TABLE_ID column and the TABLE_NAME column do not refer to the same database object.
The TABLE_ID identifies the search optimization service instance.
The TABLE_NAME shows the table ID of the base table, which is the table on which the search optimization service is enabled.
The output contains one row for each search optimization maintenance operation that is executed. Each optimization operation updates information about one table. The number of operations executed on each table depends on the number and size of updates to the data in that table.
You can use combinations of aggregate functions and GROUP BY clauses to aggregate costs per table, or across all tables.
The view shows only base table IDs, not base table names, so the view does not directly show costs associated with base tables by name.
If you want to reconcile the data in this view with a corresponding view in the ORGANIZATION USAGE schema, you must first set the timezone of the session to UTC. Before querying the Account Usage view, execute:
ALTER SESSION SET TIMEZONE = UTC;