Creating an Index for an MOT Table

Standard PostgreSQL create and drop index statements are supported.

For example –

create index  text_index1 on test(x) ;

The following is a complete example of creating an index for the ORDER table in a TPC-C workload –

create FOREIGN table bmsql_oorder (
  o_w_id       integer      not null,
  o_d_id       integer      not null,
  o_id         integer      not null,
  o_c_id       integer not null,
  o_carrier_id integer,         
  o_ol_cnt     integer,
  o_all_local  integer,
  o_entry_d    timestamp,
  primarykey (o_w_id, o_d_id, o_id)
);
 
create index  bmsql_oorder_index1 on bmsql_oorder(o_w_id, o_d_id, o_c_id, o_id) ;

NOTE: There is no need to specify the FOREIGN keyword before the MOT table name, because it is only created for create and drop table commands.

For MOT index limitations, see the Index subsection under the _SQL Coverage and Limitations _section.

Feedback
编组 3备份
    openGauss 2024-05-05 00:44:49
    cancel