sqlindexcreates

来自「数据库测试工具Benchmark,主要对数据库的性能进行了详细的测试。」· 代码 · 共 54 行

TXT
54
字号

alter table warehouse add constraint pk_warehouse 
  primary key (w_id);  
commit;  

alter table district add constraint pk_district 
  primary key (d_w_id, d_id);
commit; 


alter table customer add constraint pk_customer 
  primary key (c_w_id, c_d_id, c_id);
commit;
create index ndx_customer_name 
  on customer (c_w_id, c_d_id, c_last, c_first);
commit;


-- history table has no primary key
-- commit;


alter table oorder add constraint pk_oorder 
  primary key (o_w_id, o_d_id, o_id);
commit;
create unique index ndx_oorder_carrier 
  on oorder (o_w_id, o_d_id, o_carrier_id, o_id);
commit;

 
alter table new_order add constraint pk_new_order 
  primary key (no_w_id, no_d_id, no_o_id);
commit;


alter table order_line add constraint pk_order_line 
  primary key (ol_w_id, ol_d_id, ol_o_id, ol_number);
commit;


alter table stock add constraint pk_stock
  primary key (s_w_id, s_i_id);
commit;


alter table item add constraint pk_item
  primary key (i_id);
commit;

vacuum analyze; 

  

 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?