update : 2015.11.03
php.shukuma.com검색:
|
예약 상수이 확장은 다음의 상수들을 정의합니다. 이 확장을 PHP에 내장했거나, 실행시에 동적으로 읽어들일 경우에만 사용할 수 있습니다. SQL hint related
Example #1 Example demonstrating the usage of mysqlnd_ms constants The mysqlnd replication and load balancing plugin (mysqlnd_ms) performs read/write splitting. This directs write queries to a MySQL master server, and read-only queries to the MySQL slave servers. The plugin has a built-in read/write split logic. All queries which start with SELECT are considered read-only queries, which are then sent to a MySQL slave server that is listed in the plugin configuration file. All other queries are directed to the MySQL master server that is also specified in the plugin configuration file. User supplied SQL hints can be used to overrule automatic read/write splitting, to gain full control on the process. SQL hints are standards compliant SQL comments. The plugin will scan the beginning of a query string for an SQL comment for certain commands, which then control query redirection. Other systems involved in the query processing are unaffected by the SQL hints because other systems will ignore the SQL comments. The plugin supports three SQL hints to direct queries to either the MySQL slave servers, the MySQL master server, or the last used MySQL server. SQL hints must be placed at the beginning of a query to be recognized by the plugin.
For better portability, it is recommended to use the string constants
<?php 위 예제들의 출력: master_query = /*ms=master*/SELECT id FROM test slave_query = /*ms=slave*/SHOW TABLES
mysqlnd_ms_query_is_select() related
mysqlnd_ms_set_qos(), quality of service filter and service level related
Other
The plugins version number can be obtained using
|