1. My travel is booked for OpenSQL camp in Portland on November 14 and 15. It should be a great event in my favorite city. It is also an opportunity to speak with technical people about something other than MySQL. The current sessions are skewed towards MySQL, but Portland has an active PostgreSQL community and is home to Len Shapiro who contributed a lot to the development of high-performance hash joins. I hope there is some kind of PostgreSQL-MySQL exchange. I have yet to propose a topic, but am considering MySQL GIS, MUMPS, embedded InnoDB or the InnoDB plugin.
    2

    View comments

  2. I was debugging the performance of a DELETE statement that contained a subquery in the FROM clause. As there is no EXPLAIN for DELETE, I converted it to a SELECT statement (and hoped the same optimizations were done). But I still had to wait for EXPLAIN to complete. EXPLAIN evaluates subqueries in the FROM clause for MySQL. This can make EXPLAIN take a long time and create load on a server. Recent versions of MySQL have had many improvements for subquery optimization, but the documentation for all versions states that this is still done. A feature request is open to change this. Feature requests are also open to get EXPLAIN for UPDATE, INSERT and DELETE.

    Do other RDBMS products support EXPLAIN for subqueries in a FROM clause without evaluating the subquery?
    6

    View comments

  3. I reviewed most of the changes from the v4 Google patch today. My head hurts now. During this review I checked whether bugs fixed in the patch have also been fixed in recent releases of official MySQL. I am happy that most of them have been fixed. But some changes will never be accepted, such as the one that added support for INF for FLOAT/DOUBLE columns.

    The default value of sql_mode is the empty string. You probably want to change that before your applications come to depend on it. When it is the empty string, invalid values are coerced to valid values on INSERT and UPDATE and a warning is returned. Applications usually ignore the warnings. The coercion includes:
    • INT values that are too big are set to the maximum value of an INT. The same is done for BIGINT
    • INF is changed to MAX_DOUBLE or MAX_FLOAT for a DOUBLE/FLOAT column
    • varchar and LOB columns are truncated to not exceed the maximum length
    • invalid DATE values are accepted
    What needs this behavior? MyISAM. For a storage engine that doesn't do rollback, one way to handle invalid data during an INSERT or UPDATE statement is to coerce it to valid values and proceed with the statement. I am not fond of this approach. An alternative for data warehouse workloads is to use an exception table to log rows with invalid data and avoid corrupting non-exception tables.

    MyISAM has also made replication semantics and internals much more complex. For example, what is written to the binlog in this case, and has this behavior changed between releases?
    begin;
    insert into Innodb_table values (1);
    insert into Myisam_table values (1);
    rollback;
    
    I think that MyISAM has its place. It does fast table scans, but InnoDB is much faster on just about everything else. I am just not thrilled with the impact it has had on MySQL. It can be used for tasks where a table or partition is loaded once and then made readonly after the insert. This is a good fit for data warehouse tasks. Although it would be better were multi-core performance improved and the key cache expanded to include data blocks. MyISAM can also be used for scratch tables on a slave.

    Drizzle avoided these problems by limiting MyISAM to temporary tables.
    11

    View comments

  4. What type is used for the expression returned by this SELECT statement?
    set @x = 1e300; select @x
    
    It depends:
    • MySQL 4.0, 5.1 - double
    • MySQL 4.1, 5.0 - string
    Note that this table uses double in all releases:
    set @x = 1e300; create table tt as select @x
    
    3

    View comments

Loading