5 messages in com.mysql.lists.communityRe: Sakila 0.5, Now With Data Goodness!
FromSent OnAttachments
Mike Hillyer14 Feb 2006 20:58 
Giuseppe Maxia15 Feb 2006 01:23 
Morgan Tocker15 Feb 2006 02:27 
Mike Hillyer15 Feb 2006 07:10 
Mike Hillyer27 Mar 2006 21:07 
Subject:Re: Sakila 0.5, Now With Data Goodness!
From:Giuseppe Maxia (g.ma@stardata.it)
Date:02/15/2006 01:23:19 AM
List:com.mysql.lists.community

Mike, I raised this issue when you made your first announcement about sakila, but since you asked to repeat, here goes.

The sakila-data.sql takes about 5 minutes to load, because it does not use transactions.

Adding "set autocommit=0;" at the beginning and a "commit;" after every table dump will get the load time down to 15 seconds.

Changing the single inserts to multiple inserts will get the load time down to 8 seconds.

We would be giving MySQL a bad name if we ship a data file that takes that long (unnecessarily!) to load.

Now, there may be some concerns, because mysqldump is not capable of creating a reliable optimized dump of sakila with one command, as it is today, due to some bugs that have been already reported and hopefully will be fixed
soon. (and due to the film_text table, that is supposed to be filled by a trigger)

If you have a Unix environment, you can produce an optimized dump with this bash script:

#!/bin/bash echo "use sakila;" > sakila-data.mysql echo "set autocommit=0;" >> sakila-data.mysql

TABLES=`mysql sakila -N -e 'show full tables' |\ grep BASE | \ grep -v film_text | \ perl -lane 'print $F[0]'`

OPTIONS1='--extended-insert --no-autocommit --quick --set-charset --hex-blob' OPTIONS2='--disable-keys --skip-triggers --skip-add-locks --no-create-info' DUMPOPTIONS="$OPTIONS1 $OPTIONS2"

for T in $TABLES ; do echo $T ; mysqldump $DUMPOPTIONS sakila $T | \ perl -pe 's/\),\(/),\n(/g' >> sakila-data.mysql ; done

The resulting script is 2 MB (compared to 4.5 MB of the original script) and it loads in 8 seconds (against 5 minutes).

Ciao Giuseppe

Mike Hillyer wrote:

I've been working on populating the new Sakila schema with some data, mainly by copying data from the existing Sakila 0.1 schema.

The 0.5 version is available for download as a zip archive at http://www.openwin.org/mike/index.php/archives/2006/02/sakila-05-now-with-da ta-goodness/.

This version has two files, sakila-schema.sql and sakila-data.sql, load the schema file first, then the data file.

This is just a rough fill-in of the data, intended to provide context for discussion. Some data related suggestions have been made in the past, if they have not been met please point out any continuing issues.

Thanks again to all who take the time to review and provide feedback!

The forums are also available for discussion at http://forums.mysql.com/list.php?121

I added some views and stored procedures to the schema, but there have been no changes to the actual tables.

Version 0.5

* Added views sales_by_store and sales_by_film_category submitted by Jay Pipes. * Added stored procedure rewards_report submitted by Jay Pipes. * Added stored procedure get_customer_balance. * Added sakila-data.sql file to load data into sample database.