[UPHPU] MySQL Locking Question

Chad Sollis uphpu at sollis.net
Tue Aug 7 11:44:29 MDT 2007


Greetings,

I have a question for any MySQL pros out there.  I am using a custom
session_handler built in PHP.  The table is built on MyISAM engine.  These
queries are locking up the table as they occur creating some slowness on the
site.

SELECT session_id, session_array FROM session_table WHERE
session_key='keygoeshere' limit 0,1
DELETE FROM session_table WHERE
(UNIX_TIMESTAMP(now())-UNIX_TIMESTAMP(session_date_created))>86400

Can I reconstruct these queries to not lock the table.  I understand when
creating/updating the table it needs to lock, but I am under the assumption
that for select and delete it does not need to lock?

Any help/direction would be great.

Thank you in advance.

~Chad


More information about the UPHPU mailing list