June 19, 2013

Comment: Derived Tables and Views Performance

…/2013/05/simple-mysql-and-php-prodcuts-and-cart.html create dynamic main menu and sub menu using php and mysql mysql=mysql_connect(’127.0.0.1′,’root’,”); mysql_select_db(‘test’,$mysql); function display_menu($parent, $level) { $result = mysql_query(“SELECT a.id, a.label, a.link, Deriv1.Count FROM `menu` a LEFT OUTER JOIN

Post: Flexviews - part 3 - improving query performance using materialized views

query Incremental refresh doesn’t support all of the SQL features available to SELECT statements. Refresh type Aggregation Outer joinquerying: mysql> call flexviews.enable( -> flexviews.get_id(‘demo’,'dashboard_customer_sales’)); Query OK… This method is actually quite simple in its operation. It …

Post: Avoiding auto-increment holes on InnoDB with INSERT IGNORE

MySQL version 5.1.22 or newer? If so, you probably have gaps in your auto-increment columns. A simple INSERT IGNORE query… from mutex left outer join foo on foo.name=1 where mutex.i = 1 and foo.name is null; Query OK, 0 rows… from mutex left outer join foo on foo.name=1 where mutex.i = 1 and foo.name is null; Query OK, 0 rows…

Post: EXPLAIN EXTENDED can tell you all kinds of interesting things

MySQL optimizer does to your query. You might not know this, but MySQL can dramatically change your queryOUTER JOIN, then MySQL can immediately return an empty set because it infers that there is no way that rows could be returned. MySQL

Post: MySQL VIEW as performance troublemaker

… which appeared in MySQL 5.0 and quite frequently VIEWs are used to help in writing the queries – to keep queries simple without really… query used for temporary table creation from the outer query and plus if you use more then one Temporary Tables views which you join… lets create a very artificial query which will JOIN 2 views just to see how indexes are used: mysql> explain select uc.cnt…

Post: Using Flexviews - part one, introduction to materialized views

…the output of a SQL statement. MySQL even includes a SQL statement … essentially a consistent snapshot of the query result. It is not possible to…: Not all SQL syntax supported (no outer join), no non-deterministic functions, etc. There… Creating an MV is not as simple as I’d like. Incremental refresh…