Best way to update record X when Y is inserted

Posted by Saif Bechan on Stack Overflow See other posts from Stack Overflow or by Saif Bechan
Published on 2010-04-06T09:34:49Z Indexed on 2010/04/06 9:43 UTC
Read the original article Hit count: 147

Filed under:
|

I have a huge table that is mainly used for backup and administrative purposes. The only records that matters is the last inserted record.

On every hit to order by time inserted is just too slow. I want keep a separate table with the last inserted id.

In PHP I now insert, get last inserted id, and update the other table.

Is there a more efficient way to do this.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about database