Rechercher dans le manuel MySQL

15.19.6.5 Adapting DML Statements to memcached Operations

Benchmarks suggest that the daemon_memcached plugin speeds up DML operations (inserts, updates, and deletes) more than it speeds up queries. Therefore, consider focussing initial development efforts on write-intensive applications that are I/O-bound, and look for opportunities to use MySQL with the daemon_memcached plugin for new write-intensive applications.

Single-row DML statements are the easiest types of statements to turn into memcached operations. INSERT becomes add, UPDATE becomes set, incr or decr, and DELETE becomes delete. These operations are guaranteed to only affect one row when issued through the memcached interface, because the key is unique within the table.

In the following SQL examples, t1 refers to the table used for memcached operations, based on the configuration in the innodb_memcache.containers table. key refers to the column listed under key_columns, and val refers to the column listed under value_columns.

  1. INSERT INTO t1 (key,val) VALUES (some_key,some_value);
  2. SELECT val FROM t1 WHERE key = some_key;
  3. UPDATE t1 SET val = new_value WHERE key = some_key;
  4. UPDATE t1 SET val = val + x WHERE key = some_key;
  5. DELETE FROM t1 WHERE key = some_key;

The following TRUNCATE TABLE and DELETE statements, which remove all rows from the table, correspond to the flush_all operation, where t1 is configured as the table for memcached operations, as in the previous example.


Find a PHP function

Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-innodb-memcached-dml.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:en Manuel MySQL : https://dev.mysql.com/

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut