# select from table while inserting data

**URL:** <https://forums.percona.com/t/select-from-table-while-inserting-data/4213>\
**Category:** Other MySQL® Questions\
**Created:** [May 10, 2015, 4:24pm UTC](https://forums.percona.com/t/select-from-table-while-inserting-data/4213 "2015-05-10T16:24:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![talmo11](https://avatars.discourse-cdn.com/v4/letter/t/d26b3c/32.png) [@talmo11](https://forums.percona.com/u/talmo11)\
**Post date:** [May 10, 2015, 4:24pm UTC](https://forums.percona.com/t/select-from-table-while-inserting-data/4213/1 "2015-05-10T16:24:13Z")

</div>

Hi all!  
​  
I’m using MySQL 5.5 on Amazon RDS with innodb engine on all the tables.  
The last time I ran ‘show full processlist’ I saw a lot of queries that were ‘waiting for metadata lock’. I understood that it happens if while table X is being read by Select Query (lock s) and before the select query finishes an insert/update query executes on the same table. The second case that I see is when there’s an insert/update query running on table X (lock x) and then select query try to read data from the same table.  
I simulated those cases, and tried some solutions like ‘SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED’ (dirty read) before the select query, but it doesn’t seem to help solve the problem.
