So I did some preliminary testing with a single table. I didn't realize phpMyAdmin could copy a table so quickly, otherwise I would have tested before posting. I'm not sure if I am doing something wrong, but it seems that MyISAM is much, much, much faster at inserting rows. I'm waiting for the "gotchya!" to appear to bring me back to reality, because from everything I have read and seem to have gleaned, this should be the opposite, no?
So, a have a number of different scripts that range in time from a few minutes to several hours. I tried my fastest script, that usually takes about five minutes to complete. I ran it on the MyISAM test table and it was complete almost instantly - like five seconds. I double-checked the table and sure enough the rows were added. I thought it was a fluke so I ran it two more times with similar results. I then tried a script that normally takes ~25 minutes to complete and it was done in 12 seconds flat.
Searching also seems to be just as fast. It would appear MyISAM is much better suited for my situation but I am still skeptical. What is going on? Am I missing something? I feel like there's a huge blind spot and I'm missing something big here. This shouldn't be... should it? My knee-jerk reaction to my testing results is to copy everything over to MyISAM tables and move on, but something is holding me back.
laserlight;11006640 wrote:Maybe the solution is to have a summary table store the row count. This row count could be updated with a trigger.
This was one solution I read, but the article I read didn't mention a trigger. I'll have to look into that.
laserlight;11006640 wrote:With InnoDB, you can wrap the inserts in a transaction.
I'll look into this, too.
laserlight;11006640 wrote:Then you should have appropriate indices.
I do. The columns that are being searched are primary keys, so they have an index.
Weedpacket;11006646 wrote:You only have sixteen tables - how are you managing to get sixteen "SELECT COUNT(*) FROM tablename" queries to take more than a minute?!
When each table has 165,000+ rows I guess, though phpMyAdmin seems to have no problem producing the results in a timely manner.
Weedpacket;11006646 wrote:MyISAM is a poor choice if you're doing much writing - the lack of transactional support, the lack of concurrency support, and the lack of referential integrity protection.
I keep hearing the term "transaction" but haven't really been able to find a definition in context with databases. Could you elaborate on it? Do I actually need transactional support for my situation? And I don't really need concurrency since I am essentially the only person writing to the database, and even if there were two people trying to insert a row at the same time, they have a 1/16th chance of requiring the same table at the same time. Lastly, none of the tables relate to each other, so I have no need for referential integrity.
Thank you both for your replies.