Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • NULL values are not allowed in indexes, so it sort of looks like MySQL is using the empty string for the index value but returning the correct 'NULL' value for the field when displayed. Damn.

    You don't have index for 'user' column so it must be something else.

    --

    Ilya Martynov (http://martynov.org/ [martynov.org])

    • There's a key with the user column.

      KEY `domain_id` (`domain_id`,`user`)

      What am I misunderstanding?

      • This key is only used when you have domain_id in where condition. Order of columns in key is important [blogspot.com] (see point #3).
        --

        Ilya Martynov (http://martynov.org/ [martynov.org])

        • BTW you can see this with 'explain select':

          mysql> explain select * from mail where mail_type_id = 6 and user = '';
          +----+-------------+-------+------+---------------+--------------+--------- +-------+------+-------------+
          | id | select_type | table | type | possible_keys | key          | key_len | ref   | rows | Extra       |
          +----+-------------+-------+------+---------------+--------------+---------+ -------+------+-------------+
          |  1 | SIMPLE      | mail  | ref  | mail_type_id  | mail_type_id | 4       | const |    1 | Using where |
          +----+-------------+-------+------+---------------+--------------+---------+- ------+------+-------------+
          1 row in set (0.00 sec)
          Note that key `domain_id` is not listed as a possible key.
          --

          Ilya Martynov (http://martynov.org/ [martynov.org])