1969 件中 1011 - 1020 件を表示
« 前の 10 件 | 次の 10 件 »
Displaying posts with tag: MySQL (reset)
MySQL 5.7のEXPLAINでようやく変なUsing whereが消えた

や、EXPLAINの説明用の資料作ってて気付いたんですが、こんなサンプルテーブルに対して


mysql56> show create table cards\G
*************************** 1. row ***************************
Table: cards
Create Table: CREATE TABLE `cards` (
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`suite` varchar(6) NOT NULL,
`number` tinyint(3) unsigned NOT NULL,
UNIQUE KEY `seq` (`seq`),
KEY `suite` (`suite`)
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)

mysql56> SELECT * FROM cards ORDER BY _rowid LIMIT 3;
+-----+--------------+--------+
| seq | suite | number |
+-----+--------------+--------+
| 1 | ダイヤ | 2 |
| 2 | クラブ | 9 |
| 3 | スペード | 3 |
+-----+--------------+--------+
3 rows in set (0.01 sec) …
[さらに読む]
pt-online-schema-change(と、pt-table-checksumとかもろもろ)の--recursion-methodについて

pt-online-schema-change(以下、pt-osc)をはじめとするPercona Toolkitのツール群には、--recursion-methodというオプションがあります。

pt-online-schema-change — Percona Toolkit Documentation


暗黙のデフォルトは"processlist,hosts"で、なんとなくprocesslist(SHOW PROCESSLISTからBinlog Dump Threadのホスト名を引っ張り挙げる)とhosts(SHOW SLAVE HOSTSの結果からホスト名とポート番号を引っ張り挙げる)をよしなにミックスしてくれそうな雰囲気なれど。

これ残念ながら単にprocesslistだけ指定した時と同じ結果になります。

( ´-`).oO(全くトリアージされる気はしないけど、一応ばぐれぽも上げた

[さらに読む]
MySQL5.7 with FTS Mecab

mecabプラグイン
MySQL5.7からmecabプラグインが利用出来るようになるので、基本的な動作確認をしました。
現状では、eucjpms (ujis), cp932 (sjis), and utf8 (utf8mb4)のみ対応している状態です。

Mecabについて
http://ja.wikipedia.org/wiki/MeCab

参考: 
InnoDB Full-Text: MeCab Parser
http://planet.mysql.com/entry/?id=5989321

初期設定
Plugin Directoryにモジュールや設定ファイルがあります。

[root@misc01 mecab]# ls -l …
[さらに読む]
MySQL5.7 with FTS NGRAM(IN BOOLEAN MODE)

一つ前のPOSTで検証したデータでそのまま、NGRAMにてIN BOOLEAN MODEを使い検索してみました。

Natural Language
自然言語処理
By default or with the IN NATURAL LANGUAGE MODE modifier,
the MATCH() function performs a natural language search for a string against a text collection.
– text searched for is converted to a union of n-gram values. For example, ‘sql’ is converted to ‘sq ql’ (with a default token size of 2 or bigram).

Boolean
真(true)と偽(false)の2種類の値だけを扱う型 (“+”、”-“で条件設定可能)
MySQL can perform boolean full-text searches using the IN BOOLEAN MODE modifier.
With this modifier, certain characters have special meaning at the beginning or end of words in the search …

[さらに読む]
MySQL5.7 with FTS NGRAM(NATURAL LANGUAGE MODE)

MySQL5.7から実装されるInnoDBの全文検索 in CJKモードの挙動について。
Natural Language Full-Text Searchsについて。

12.9.1 Natural Language Full-Text Searches
http://dev.mysql.com/doc/refman/5.7/en/fulltext-natural-language.html
By default or with the IN NATURAL LANGUAGE MODE modifier,
the MATCH() function performs a natural language search for a string against
a text collection. A collection is a set of one or more columns included in a FULLTEXT index.
The search string is given as the argument to AGAINST().

テストバージョン

検証用DB、テーブル、データの作成。

[さらに読む]
MySQLのperformance_schemaをフルパワーにするとどんな情報が見られるのか

日々の覚書: MySQLのperformance_schemaでどれくらいの情報が見られるのか の続き。


* events_stages_summary_by_account_by_event_name
* events_stages_summary_by_host_by_event_name
* events_stages_summary_by_thread_by_event_name
* events_stages_summary_by_user_by_event_name
* events_stages_summary_global_by_event_name

mysql> SELECT * FROM events_stages_summary_by_account_by_event_name WHERE count_star <> 0 ORDER BY sum_timer_wait DESC LIMIT 3;
+------------+-----------+-------------------------+------------+----------------+----------------+----------------+----------------+
| USER | HOST | EVENT_NAME | COUNT_STAR | SUM_TIMER_WAIT | MIN_TIMER_WAIT | AVG_TIMER_WAIT | MAX_TIMER_WAIT | …
[さらに読む]
MySQLのperformance_schemaでどれくらいの情報が見られるのか

MySQL :: MySQL 5.6 Reference Manual :: 22 MySQL Performance Schema

5.6以降「よくなったよ!」「確かにね! でもメモリー」「」みたいな感じで扱われて結局まだONにしているインスタンスの少ないPerformance Schemaなのでちょっと練習中。

tpcc-mysqlとかでやると割と綺麗なクエリーをしているので面白い情報が出ない(ibdata1のfsyncに時間がかかってることなんて知ってるよ! って感じになる)ので、isucon2のアプリで試してみることにしますた。モリスさん++

livedoor Techブログ : 自家製 #isucon2 のつくりかた


[さらに読む]
MySQL5.7.6DMR準備

MySQL5.7.6DMRが今月リリースされて、色々な機能追加や改善が施されているので、
DMRのうちに少しずつ検証してRCとGAに備えたいと思います。
とりあえず、本日は初期設定まで。

2015年3月現在

MySQL 5.7 Release Notes
http://dev.mysql.com/doc/relnotes/mysql/5.7/en/index.html

ダウンロードサイトからDMRをダウンロードしてきてあります。
mysql-5.7.6-m16-linux-glibc2.5-x86_64.tar.gz

[root@misc01 admin]# cd /usr/local/
[root@misc01 local]# ls -l
合計 545048
drwxr-xr-x. 2 root  root          6  6月 10  2014 bin
drwxr-xr-x. 2 root  root          6  6月 10  2014 etc
drwxr-xr-x. 2 root  root …
[さらに読む]
FLUSH TABLES WITH READ LOCKについて

FLUSH TABLES WITH READ LOCKをバックグラウンドで実行する処理がある場合に、
長時間実行しているバッチなどの処理があると、後から実行されるQueryが待たされるケースがある。
そんな、話を多からず、少なからず質問頂くので一応メモとして動作を記録。

通常は、データベース側の処理はDurationは短いので問題無いですが。。。
長時間バッチが実行されるような処理がある場合を避けて、FLUSH TABLES WITH READ LOCKを含む処理を実行するのが良さそうです。
MyISAMが全て無くなればまた、少しだけ選択肢が増えそうです。

[さらに読む]
MySQL 5.7でやっと(?)1テーブル複数トリガーが仕掛けられるようになった

As of MySQL 5.7.2, it is possible to define multiple triggers for a given table that have the same trigger event and action time. For example, you cannot have two BEFORE UPDATE triggers for a table. By default, triggers that have the same trigger event and action time activate in the order they were created. To affect trigger order, specify a trigger_order clause that indicates FOLLOWS or PRECEDES and the name of an existing trigger that also has the same trigger event and action time. With FOLLOWS, the new trigger activates after the existing trigger. With PRECEDES, the new trigger activates before the existing trigger.MySQL :: MySQL 5.7 Reference Manual :: 13.1.16 CREATE TRIGGER Syntax


試してみよう。

5.6のフツーの動作は

mysql56> CREATE TRIGGER before_insert_1 BEFORE INSERT ON t1 …
[さらに読む]
1969 件中 1011 - 1020 件を表示
« 前の 10 件 | 次の 10 件 »