Changeset 19455


Ignore:
Timestamp:
2010/11/07 03:07:08 (12 years ago)
Author:
fukuda
Message:

インデックス付与をテーブル(dtb_index_list)から判断するように変更

Location:
branches/camp/camp-2_5-D/html/install
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/camp/camp-2_5-D/html/install/index.php

    r18820 r19455  
    136136    // テーブルの作成 
    137137    $objPage->arrErr = lfExecuteSQL("./sql/create_table_".$arrRet['db_type'].".sql", $dsn); 
     138 
    138139    if(count($objPage->arrErr) == 0) { 
    139140        $objPage->tpl_message.="○:テーブルの作成に成功しました。<br>"; 
     
    160161        } else { 
    161162            $objPage->tpl_message.="×:初期データの作成に失敗しました。<br>"; 
     163        } 
     164    } 
     165 
     166    // インデックスの作成 
     167    if(count($objPage->arrErr) == 0){ 
     168        $objPage->arrErr = lfCreateIndex(); 
     169        if(count($objPage->arrErr) == 0) { 
     170            $objPage->tpl_message.="○:初期インデックスの作成に成功しました。<br>"; 
     171        } else { 
     172            $objPage->tpl_message.="×:初期インデックスの作成に失敗しました。<br>"; 
    162173        } 
    163174    } 
     
    785796} 
    786797 
     798// SQL文の実行 
     799function lfCreateIndex(){ 
     800    $objQuery = new SC_Query(); 
     801 
     802    $arrRet = $objQuery->select("*", "dtb_index_list"); 
     803    for ($i=0; $i<count($arrRet); $i++){ 
     804        if ($arrRet[$i]["recommend_flg"] == 1){ 
     805            $index_name = $arrRet[$i]["table_name"]."_".$arrRet[$i]["column_name"]."_key"; 
     806            $objQuery->createIndex($arrRet[$i]["table_name"], $index_name, array('fields' => array($arrRet[$i]["column_name"] => array()))); 
     807        } 
     808    } 
     809} 
     810 
    787811/** 
    788812 * シーケンスを削除する. 
     
    871895    global $objWebParam; 
    872896    global $objDBParam; 
    873      
     897 
    874898    $normal_url = $objWebParam->getValue('normal_url'); 
    875899    // 語尾に'/'をつける 
  • branches/camp/camp-2_5-D/html/install/sql/column_comment.sql

    r18910 r19455  
    598598INSERT INTO dtb_table_comment (id, table_name, column_name, description) VALUES (612, 'dtb_mobile_kara_mail', 'email', 'メールアドレス'); 
    599599INSERT INTO dtb_table_comment (id, table_name, column_name, description) VALUES (613, 'dtb_mobile_kara_mail', 'receive_date', '受信日時'); 
     600INSERT INTO dtb_table_comment (id, table_name, column_name, description) VALUES (660, 'dtb_index_list', 'recommend_flg', '1:初期付与 2:付与推奨'); 
  • branches/camp/camp-2_5-D/html/install/sql/create_table_mysql.sql

    r19369 r19455  
    12551255    recommend_comment text 
    12561256) TYPE=InnoDB;; 
    1257  
    1258 CREATE INDEX dtb_customer_mobile_phone_id_key ON dtb_customer (mobile_phone_id(64)); 
    1259 CREATE INDEX dtb_products_class_product_id_key ON dtb_products_class(product_id); 
    1260 CREATE INDEX dtb_order_detail_product_id_key ON dtb_order_detail(product_id); 
    1261 CREATE INDEX dtb_send_customer_customer_id_key ON dtb_send_customer(customer_id); 
    1262 CREATE INDEX dtb_mobile_ext_session_id_param_key_key ON dtb_mobile_ext_session_id (param_key(64)); 
    1263 CREATE INDEX dtb_mobile_ext_session_id_param_value_key ON dtb_mobile_ext_session_id (param_value(64)); 
    1264 CREATE INDEX dtb_mobile_ext_session_id_url_key ON dtb_mobile_ext_session_id (url(64)); 
    1265 CREATE INDEX dtb_mobile_ext_session_id_create_date_key ON dtb_mobile_ext_session_id (create_date); 
    1266 CREATE INDEX dtb_mobile_kara_mail_token_key ON dtb_mobile_kara_mail (token(64)); 
    1267 CREATE INDEX dtb_mobile_kara_mail_create_date_key ON dtb_mobile_kara_mail (create_date); 
    1268 CREATE INDEX dtb_mobile_kara_mail_receive_date_key ON dtb_mobile_kara_mail (receive_date); 
  • branches/camp/camp-2_5-D/html/install/sql/create_table_pgsql.sql

    r19336 r19455  
    12541254    recommend_comment text 
    12551255); 
    1256  
    1257 CREATE INDEX dtb_customer_mobile_phone_id_key ON dtb_customer (mobile_phone_id); 
    1258 CREATE INDEX dtb_products_class_product_id_key ON dtb_products_class(product_id); 
    1259 CREATE INDEX dtb_order_detail_product_id_key ON dtb_order_detail(product_id); 
    1260 CREATE INDEX dtb_send_customer_customer_id_key ON dtb_send_customer(customer_id); 
    1261  
    1262 CREATE INDEX dtb_mobile_ext_session_id_param_key_key ON dtb_mobile_ext_session_id (param_key); 
    1263 CREATE INDEX dtb_mobile_ext_session_id_param_value_key ON dtb_mobile_ext_session_id (param_value); 
    1264 CREATE INDEX dtb_mobile_ext_session_id_url_key ON dtb_mobile_ext_session_id (url); 
    1265 CREATE INDEX dtb_mobile_ext_session_id_create_date_key ON dtb_mobile_ext_session_id (create_date); 
    1266  
    1267 CREATE INDEX dtb_mobile_kara_mail_token_key ON dtb_mobile_kara_mail (token); 
    1268 CREATE INDEX dtb_mobile_kara_mail_create_date_key ON dtb_mobile_kara_mail (create_date); 
    1269 CREATE INDEX dtb_mobile_kara_mail_receive_date_key ON dtb_mobile_kara_mail (receive_date); 
  • branches/camp/camp-2_5-D/html/install/sql/insert_data.sql

    r19336 r19455  
    10861086 
    10871087INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_customer', 'email_mobile', 0, '会員数増加時のログイン処理速度を向上させたいときに試してみてください'); 
    1088 INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_products', 'name', 1, '商品名検索速度を向上させたいときに試してみてください'); 
     1088INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_products', 'name', 2, '商品名検索速度を向上させたいときに試してみてください'); 
    10891089INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_order_temp', 'order_temp_id', 0, '注文数が多いときに試してみてください。'); 
    1090 INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_order', 'status', 1, '注文数が多いときに試してみてください。'); 
    1091 INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_order', 'order_email', 1, '注文数が多いときに試してみてください。'); 
    1092 INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_order', 'order_name01', 1, '注文数が多いときに試してみてください。'); 
     1090INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_order', 'status', 2, '注文数が多いときに試してみてください。'); 
     1091INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_order', 'order_email', 2, '注文数が多いときに試してみてください。'); 
     1092INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_order', 'order_name01', 2, '注文数が多いときに試してみてください。'); 
    10931093INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_order', 'order_name02', 0, '注文数が多いときに試してみてください。'); 
    10941094INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_order', 'order_tel01', 0, '注文数が多いときに試してみてください。'); 
    10951095INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_order', 'order_tel02', 0, '注文数が多いときに試してみてください。'); 
    10961096INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_order', 'order_tel03', 0, '注文数が多いときに試してみてください。'); 
     1097INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_customer', 'mobile_phone_id', 1, ''); 
     1098INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_products_class', 'product_id', 1, ''); 
     1099INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_order_detail', 'product_id', 1, ''); 
     1100INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_send_customer', 'customer_id', 1, ''); 
     1101INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_mobile_ext_session_id', 'param_key', 1, ''); 
     1102INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_mobile_ext_session_id', 'param_value', 1, ''); 
     1103INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_mobile_ext_session_id', 'url', 1, ''); 
     1104INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_mobile_ext_session_id', 'create_date', 1, ''); 
     1105INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_mobile_kara_mail', 'token', 1, ''); 
     1106INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_mobile_kara_mail', 'create_date', 1, ''); 
     1107INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_mobile_kara_mail', 'receive_date', 1, ''); 
     1108INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('dtb_product_categories', 'category_id', 2, 'カテゴリが多いときに試してみてください。'); 
     1109INSERT INTO dtb_index_list (table_name, column_name, recommend_flg, recommend_comment) VALUES ('mtb_zip', 'zipcode', 2, '郵便番号検索が遅いときに試してみてください。郵便番号データの更新時には無効にしていることをおすすめします。'); 
Note: See TracChangeset for help on using the changeset viewer.