Re: Performance question for table updating

From: Date: Sun, 25 Nov 2007 23:37:56 +0000
Subject: Re: Performance question for table updating
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-265010@lists.php.net to get a copy of this message
    Eventually, I wind up with a query similar to:
        UPDATE table_01 SET field_a = 'New value here', updated=CURDATE() WHERE primary_key=12345
Even though you've solved it one way to work out the problem here would be to change it to a select query (unfortunately mysql can't explain insert/update/delete statements - which would make it a lot easier). ie change it to select 1 from table where primary_key=12345; If that's slow, then you're missing an index on primary_key. If that's fast.. err, you're back to square one :/ or maybe you have too many indexes (which means the update process is spending all of it's time updating the fields & indexes). -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.general (#265010) next »