Skip to content

Items table population is a single transaction doing 100000 inserts #500

Answered by sm-shaw
akanimesh7 asked this question in Q&A
Discussion options

You must be logged in to vote

OK so as it is open source, we can do a quick test by modifying the build script to time the item load:

set TIME_start [clock clicks -milliseconds]
LoadItems $mysql_handler $MAXITEMS
set TIME_elapsed [expr ([clock clicks -milliseconds] - $TIME_start) / 1000 ]
puts "Items loaded in $TIME_elapsed seconds"

On a test laptop, it takes 11 seconds to load the items table:

Also if you look in the source you can see that it is not loading all the rows in one insert, however instead it is reporting the rows loaded only at 50K and 100K, it does in fact load each row with a separate insert.

mysql::exec $mysql_handler "insert into item (`i_id`, `i_im_id`, `i_name`, `i_price`, `i_data`) VALUES ('$i_i…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sm-shaw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #499 on January 31, 2023 17:30.