|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
|||
|
|||
|
Can a Select query "lock" the database?
I recently had a problem with a MySQL database that I query using PHP. The site was running properly and suddenly, it was impossible to edit the database (browsing was still possible).
My hosting provider told me "that some of the larger/complex queries seem to be locking the database. The "SELECT DISTINCT" queries may be causing this issue. " Is it possible? And how can I identify which query lock the database? Thanks for your help. |
|
#2
|
|||
|
|||
|
RE: Can a Select query
How much load is on your database?
As far as I know, insert queries and such are delayed until all pending selects are finished. If selects come in all the time, it is possible the otbers are never performed. If you want to modify a table, you can get a write lock on it, since then no more queries will start on it. Don't quote me on this, read the manual for 'lock table'. |
|
#3
|
|||
|
|||
|
RE: Can a Select query
I finally found the problem. There was a Select query that missed () and it sort of locked the database.
I had something like "AND entreprise like '%xyz%' OR entreprise like '%abc%'" while I needed "AND (entreprise like '%xyz%' OR entreprise like '%abc%') Quite simple but I looked a while before catching this one! |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > Can a Select query "lock" the database? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|