Page 1 of 1

Which is faster...

Posted: Wed Jan 27, 2010 9:06 pm
by JakeJ
Is it faster to drop a table and recreate it or is it faster to drop all the records in the table?

The table in question will only have up to 25 records with 12 fields each.

I suppose dropping all records then optimizing table is slower than dropping an recreating an empty table.

What do best practices indicate?

Thanks!

Re: Which is faster...

Posted: Wed Jan 27, 2010 9:52 pm
by AbraCadaver
I'm not sure. I would assume dropping the table faster, but unless you have millions or more of records I'm not sure it would be measurable and worth the time to consider. It would be easier and less code to truncate the table, and I would go that route.

Re: Which is faster...

Posted: Thu Jan 28, 2010 9:05 pm
by stevenrokz
In table with less records dropping & recreating a table would be faster process, but dropping a table with huge data , i am not sure about

Re: Which is faster...

Posted: Fri Jan 29, 2010 11:14 am
by pickle
With only 25 rows, it doesn't really matter. I'd say go with whichever makes your PHP code simpler.