亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Indexing on Virtual Columns

發布時間:2020-08-17 22:16:06 來源:ITPUB博客 閱讀:118 作者:yyp2009 欄目:關系型數據庫
    
     
Virtual columns can be indexed like any other non virtual columns. The index created is always a function based index. If the index is B-tree index, it is recognized as FUNCTION-BASED NORMAL. For bitmap indexes, it is recognized as FUNCTION-BASED BITMAP.

SQL> col DATA_TYPE for a30
SQL> col DATA_DEFAULT for a30
SQL> SELECT column_name, data_type, data_length, data_default, virtual_column
  2  FROM user_tab_cols
  3  WHERE table_name = 'ORDERS_VCOL';

COLUMN_NAME                    DATA_TYPE                                              DATA_LENGTH DATA_DEFAULT                   VIR
------------------------------ ------------------------------ -----------                               ------------------------------ ---
ORDER_ID                       NUMBER                                                       22                                NO
ORDER_DATE                     TIMESTAMP(6) WITH LOCAL TIME ZONE        11                                NO
ORDER_MODE                     VARCHAR2                                 8                                NO
CUSTOMER_ID                    NUMBER                                  22                                NO
ORDER_STATUS                   NUMBER                                  22                                NO
ORDER_TOTAL                    NUMBER                                  22                                NO
SALES_REP_ID                   NUMBER                                  22                                NO
PROMOTION_ID                   NUMBER                                  22                                NO
VCOL_GMT                       TIMESTAMP(6)                            11 SYS_EXTRACT_UTC("ORDER_DATE")  YES

9 rows selected.
SQL>  create index index_vcol  on  orders_vcol(VCOL_GMT);
Index created.
SQL>
SQL> select index_name,index_type,funcidx_status from user_indexes where table_name='ORDERS_VCOL';

INDEX_NAME                     INDEX_TYPE                  FUNCIDX_
------------------------------ --------------------------- --------
ORDERS_VPK                     NORMAL
INDEX_VCOL                     FUNCTION-BASED NORMAL  ENABLED

SQL> SQL>
SQL>
SQL> select * from user_ind_expressions where index_name='INDEX_VCOL';

INDEX_NAME                     TABLE_NAME                COLUMN_EXPRESSION                                                                COLUMN_POSITION
------------------------------ ------------------------- -------------------------------------------------------------------------------- ---------------
INDEX_VCOL                     ORDERS_VCOL               SYS_EXTRACT_UTC("ORDER_DATE")                                                                  1

SQL> drop index INDEX_VCOL;

Index dropped.
SQL>
SQL>
SQL>  create bitmap index INDEX_VCOL on ORDERS_VCOL(VCOL_GMT);
 create bitmap index INDEX_VCOL on ORDERS_VCOL(VCOL_GMT)
                                   *
ERROR at line 1:
ORA-25122: Only LOCAL bitmap indexes are permitted on partitioned tables

SQL>
SQL> SELECT table_name, partition_name, high_value, num_rows
  2  FROM   user_tab_partitions
  3  where  table_name='ORDERS_VCOL'
  4  ORDER BY table_name, partition_name;

TABLE_NAME                PARTITION_NAME       HIGH_VALUE                                 NUM_ROWS
------------------------- -------------------- ---------------------------------------- ----------
ORDERS_VCOL               Q1_2005              TIMESTAMP' 2005-04-01 00:00:00'
ORDERS_VCOL               Q2_2005              TIMESTAMP' 2005-07-01 00:00:00'
ORDERS_VCOL               Q3_2005              TIMESTAMP' 2005-10-01 00:00:00'
ORDERS_VCOL               Q4_2005              TIMESTAMP' 2006-01-01 00:00:00'

SQL>
SQL>
SQL> drop table ORDERS_VCOL;

Table dropped.

SQL> CREATE TABLE orders_vcol
  2      ( order_id           NUMBER(12),
  3        order_date         TIMESTAMP WITH LOCAL TIME ZONE,
  4        order_mode         VARCHAR2(8),
  5        customer_id        NUMBER(6),
  6        order_status       NUMBER(2),
  7        order_total        NUMBER(8,2),
  8        sales_rep_id       NUMBER(6),
  9        promotion_id       NUMBER(6),
 10        vcol_gmt TIMESTAMP AS (SYS_EXTRACT_UTC(order_date))
 11        virtual,
 12        CONSTRAINT orders_vpk PRIMARY KEY(order_id)
 13      );

Table created.

SQL>
SQL>  create bitmap index INDEX_VCOL on ORDERS_VCOL(VCOL_GMT);
Index created.

SQL> select index_name,index_type,funcidx_status from user_indexes where table_name='ORDERS_VCOL';

INDEX_NAME                     INDEX_TYPE                  FUNCIDX_
------------------------------ --------------------------- --------
ORDERS_VPK                     NORMAL
INDEX_VCOL                     FUNCTION-BASED BITMAP       ENABLED

SQL> select * from user_ind_expressions where index_name='INDEX_VCOL';

INDEX_NAME                     TABLE_NAME                COLUMN_EXPRESSION                                                                COLUMN_POSITION
------------------------------ ------------------------- -------------------------------------------------------------------------------- ---------------
INDEX_VCOL                     ORDERS_VCOL               SYS_EXTRACT_UTC("ORDER_DATE")                                                                  1




向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

柘荣县| 沂水县| 怀来县| 彭山县| 西畴县| 武宁县| 石林| 旬邑县| 兴文县| 衡南县| 哈尔滨市| 海南省| 侯马市| 增城市| 泸西县| 炉霍县| 阿勒泰市| 长乐市| 阳新县| 吴忠市| 永登县| 杭锦旗| 海宁市| 兴安盟| 房山区| 芒康县| 莒南县| 招远市| 南宫市| 专栏| 翁源县| 固阳县| 天等县| 呼玛县| 定西市| 莆田市| 师宗县| 辽阳市| 柳江县| 清原| 鹿泉市|