List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:December 27 1999 3:44pm
Subject:Mysql hangs during inserts on table.
View as plain text  
Hi!

I was scanning old mails to check if we have any unsolved problems and
come across the belove mail message.  Do you still have this problem
or have you managed to solve this?

Anyway, are you sure you don't have any SELECT running when this
happens?  If you have, then the INSERT will have to wait until the
SELECT is ready before being able to continue.   MySQL 3.23.7 will
however allow INSERTs and SELECTs at the same time, so upgrading may help
solve your problem..

Regards,
Monty

>>>>> "Alex" == Alex Osipov <alex@stripped> writes:

>> Description:
Alex> I have a table and whenever I try to insert something into it, it freezes
Alex> and does not return any error and since it is locked while trying to insert
Alex> the selects running on the same table do not work and it remains frozen until
Alex> I do mysqladmin kill id.  I have tried using low_priority, delayed, and normal
Alex> inserts on the table but all of them seem to freeze the same way.

mysql> explain images;
Alex> +----------+--------------+------+-----+---------------------+-------+
Alex> | Field    | Type         | Null | Key | Default             | Extra |
Alex> +----------+--------------+------+-----+---------------------+-------+
Alex> | date     | datetime     |      | MUL | 0000-00-00 00:00:00 |       |
Alex> | section  | varchar(25)  |      | MUL |                     |       |
Alex> | filename | varchar(255) |      | MUL |                     |       |
Alex> +----------+--------------+------+-----+---------------------+-------+

mysql> insert low_priority into images (date,section,filename)
Alex> values(NOW(),'section1','/home/image1.udo');
Alex> Then it freezes and I have to kill thread using mysqladmin, same goes for
Alex> delayed and normal inserts like I've said before.

Alex> Here is the line from mysqladmin processlist
Alex> | 11744 | www | localhost | www | Query     | 50   | Locked | insert
Alex> low_priority into images (date,section,filename)
Alex> values(NOW(),'section1','/home/image1.udo') |
Alex> | 11745 | www | localhost | www | Query     | 37   | Locked | select filename
Alex> from images where section = 'section1' order by date desc; |

mysql> explain select filename from images where section = 'section1' order by
Alex> date desc;

Alex> +--------+------+-----------------------------+--------------+---------+--------
Alex> --+------+-------+
Alex> | table  | type | possible_keys               | key          | key_len | ref
Alex> | rows | Extra |

Alex> +--------+------+-----------------------------+--------------+---------+--------
Alex> --+------+-------+
Alex> | images | ref  | images_index,section,iindex | images_index |      25 |
Alex> section1 |    1 |       |

Alex> +--------+------+-----------------------------+--------------+---------+--------
Alex> --+------+-------+

Alex> If anyone knows how to fix this please let me know.  Thank you.

<cut>
Thread
Mysql hangs during inserts on table.Alex Osipov28 Nov
  • Re: Mysql hangs during inserts on table.sinisa28 Nov
  • Re: Mysql hangs during inserts on table.Alex Osipov29 Nov
    • Re: Mysql hangs during inserts on table.sinisa29 Nov
  • Re: Mysql hangs during inserts on table.Alex Osipov29 Nov
  • Mysql hangs during inserts on table.Michael Widenius27 Dec
  • Re: Mysql hangs during inserts on table.Alex Osipov29 Dec