June 19, 2013

Comment: Sphinx search performance optimization: attribute-based filters

…, – please note that, as stated in the article, this technique only works well for highly selective attributes. If attributes only have few… want to use this. Please see “Highly selective columns only” section for examples where it doesn’t work well for us too…

Post: Replication in MySQL 5.6: GTIDs benefits and limitations - Part 2

… replication. That will show where GTIDs shine and where improvements are expected. …). s2> select count(*) from t; +———-+ | count(*) | +———-+ | 2 | +———-+ # s1 is behind s1> select count(*) from t; +———-+ | count…solution of course, but very poor in my opinion: look for the …

Post: Migrating between MySQL schemas with Percona Xtrabackup

… running server.  However, you need to have existing table structures in place.  Fortunately, this can be done easily using mysqldump –no…’ > discard-ddl.sql SELECT CONCAT(‘ALTER TABLE `’, table_name, ‘` DISCARD TABLESPACE;’) AS _ddl FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=’orig’ AND…

Post: MySQL Query Patterns, Optimized - Webinar questions followup

… just running the query in a suboptimal form. Q: Doesn’t the primary key solution for random selection only work when the… returned in a different order from what you specify in the query? The tuple comparison you’re referring to is this example: WHERE… it would have to match the order of columns in the index.  Example: WHERE (last_name, first_name) = (‘Karwin’, ‘Bill’); Q: On…

Post: Choosing a MySQL HA Solution - MySQL Webinar: June 5

Selecting the most appropriate solution for a MySQL HA infrastructure …. This webinar will be both technical and non-technical in nature, beginning with a discussion of some general HA … stack) and then conclude with some typical use cases where a given approach may be well-suited or particularly …

Comment: INSERT INTO ... SELECT Performance with Innodb tables.

… fetching rows, thread declared inside InnoDB 334 mysql tables in use 4, locked 4 3264 lock struct(s), heap … root Copying to tmp table create table t as SELECT ld.label_id, cai.inventory_id, COUNT(1) as …_to_device ld on (ld.device_id = d.id) where ld.trash = ‘f’ and cai.trash = ‘f’ and (cai….

Post: How to recover table structure from InnoDB dictionary

… table id to find indexes of the table. mysql> select * from SYS_TABLES WHERE NAME=’sakila/actor’; +————–+—–+——–+——+——–+———+————–+——-+ | NAME | ID | N_COLS | TYPE… names explain their content. Index id in our example is 1679: mysql> SELECT * FROM SYS_FIELDS WHERE INDEX_ID = 1679; +———-+—–+———-+ | INDEX_ID | POS…

Post: More on MySQL transaction descriptors optimization

… perfect case for read-only transaction optimization in MySQL 5.6, because all SELECT queries in the AUTOCOMMIT mode are, by definition, read… become obvious. In the following test sysbench does 9 primary key SELECTs followed by a PK UPDATE statement in each thread in a loop…: select avg(id) from sbtest$i force key (primary) select count(*) from sbtest$i WHERE k like ‘%0%’ SysBench-0.5/lua: POINT_SELECT

Comment: ORDER BY ... LIMIT Performance Optimization

Hello everybody, We tried the solution base on query see in older post : SELECT * FROM sites WHERE category_id=5 ORDER BY date_created DESC LIMIT 10 changed to select * FROM (SELECT * FROM sites WHERE category_id=5 ORDER BY date_created DESC) as my_table LIMIT 10 It works for us !

Post: MySQL 5.6 - InnoDB Memcached Plugin as a caching layer

… per/cmd 0.0951 ms range per/cmd InnoDB MySQL Select (same table): Fetching [1,000,000] items: 441573 ms total… Select showed 27% increase over InnoDB fetch (~.09 ms/op) This replaced $cache->load() with $db->query(“SELECT * FROM memcached.container WHERE id=’key_id’”); id is PK of the container table While there are increases in both operations…