This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* mongoDB */ | |
use data_eng | |
db.winelist.insert({name:"シャブリ",color:"white"}) | |
db.winelist.insert({name:"ジュヴレシャンベルタン",color:"red"}) | |
db.winelist.insert({name:"サンテミリオン",color:"red"}) | |
db.winelist.insert({name:"オーメドック",color:"red"}) | |
db.winelist.insert({name:"サンセール",color:"white"}) | |
db.winelist.find({color:"red"}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#nodeのインストール | |
sudo sh -c "curl -sL https://rpm.nodesource.com/setup | bash -" | |
sudo yum install gcc-c++ make | |
sudo yum install nodejs | |
sudo yum install npm | |
#モジュールのインストール | |
#プログラムのおいてあるディレクトリのみ有効にする場合 | |
npm install mongodb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AVLTree /////////////////////////////////////////////////////////////////// | |
// This file is originally from the Concentré XML project (version 0.2.1) | |
// Licensed under GPL and LGPL | |
// | |
// Modified by Jeremy Stephens. | |
// Pass in the attribute you want to use for comparing | |
function AVLTree(n, attr) { | |
this.init(n, attr); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default-storage-engine=Aria |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--もし学籍番号が70310051の場合 | |
SELECT * FROM geotag WHERE id = ( | |
SELECT id FROM geotag | |
ORDER BY id | |
LIMIT 1 | |
OFFSET 310051); | |
-- ^^^^^^---ここに学生番号の先頭の70をとった数値を入れる。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ブログラムのタイムアウトの設定 | |
#以下の行を見つける | |
max_execution_time = 30 | |
#次のように書きかえる | |
max_execution_time = 300 | |
#-------------------------------- | |
#画面へのエラー表示の設定 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--メタデータを保持しているDBへ移動 | |
use information_schema; | |
select table_name,data_length,index_length from partitions where table_name='geotag' or table_name='tag'; | |
--実験用DBへ戻る | |
use CSexp1DB; | |
-- ^^^^^^^^これは皆さん個人のデータベース名に読み替えてくださいね。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--メタデータを保持しているDBへ移動 | |
use information_schema; | |
select table_name,data_length,index_length from partitions where table_name='geotag' or table_name='tag'; | |
--実験用DBへ戻る | |
use CSexp1DB; | |
-- ^^^^^^^^これは皆さん個人のデータベース名に読み替えてくださいね。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--インデクスを強制的に使用しないで問い合わせをする方法 | |
SELECT * FROM geotag IGNORE INDEX (PRIMARY) WHERE id = 7738073352; | |
--PRIMARYは主キーに自動で付けられるインデクスの名前 | |
--この場合は検索に時間がかかります。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--インデクスを作成しているフィールドで検索 | |
SELECT * FROM geotag WHERE id = 7738073352; | |
-- 0secで結果が返ってきます | |
--インデクスを作成していないフィールドで検索 | |
SELECT * FROM geotag WHERE latitude = 38.9466; | |
-- 14sec程度かかります |