SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    May 2007
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    locking all tables

    Hi,

    I'm using a couple of myisam tables for search operations cause they have a much better performance than innodb tables. Those tables are getting updated every night at 3 o clock by a cronjob.

    Now my question:
    It is a kind of stupid work to lock all of those tables and some of them several times with aliases. I would prefer to lock the whole database for that time as it is only some seconds and it's in the middle of the night. Do you know something like "lock database foo write"?

    Greetings, Andreas

  2. #2
    masquerading Nick's Avatar
    Join Date
    Jun 2003
    Location
    East Coast
    Posts
    2,215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It seems like the flush command will lock the entire database. Not sure if that is the best way to do this though, but it is mentioned in the MySQL doc
    Nick . all that we see or seem, is but a dream within a dream
    Show someone you care, send them a virtual flower.
    Good deals on men's watches

  3. #3
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    if you only need it for a few seconds, then you probably don't need the locks at all.

    why do you think you need the locks?
    Check out our new Industry News forum!
    Keep up-to-date with the latest SP news in the Community Crier

    I edit the SitePoint Podcast


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •