Using transactions for performance


show more Using transactions for performance provides you with in-depth training on Developer. Taught by Bill Weinman as part of the MySQL Essential Training show less
please wait ...

Using transactions for performance

Transactions are also commonly used to increase performance. If a long list of inserts or updates are performed as a transactional unit, they can perform much faster. For this example, we're going to use the scratch database. I'm going to start by creating a simple table. CREATE TABLE and we'll call it test and we'll give it an ID column and a data column. So I'll go ahead and execute that and our table has been created.

Now I'm going to insert some rows. I'm going to insert 1,000 rows but they'll all be the same. So it will be pretty easy to code this. INSERT INTO test, the data column, values, and 'this is a good sized line of text' and now I'm going to copy and paste this a thousand times and we'll just select count to make sure. I'll go ahead and execute this and you see we have a 1,000 rows and it took 543.27 milliseconds.

If I do this again a couple of times, you see the number will decrease a little bit but now it's still in the 300 millise...

Using transactions for performance
Video duration: 2m 20s 4h 24m Beginner

Viewers:

Using transactions for performance provides you with in-depth training on Developer. Taught by Bill Weinman as part of the MySQL Essential Training

Subject:
Developer
Software:
MySQL
Author:
please wait ...