c++ - Creating temporary table while still accessing other tables -


i've got 2 or more databases attached 1 sqlite database connection. each database consists of 3 tables. have better access searching/filtering, create huge temporary table on tables , databases this:

"create temporary table temp_table "    "select * pb.name_table "        "left join pb.phone_table on (pb.name_table.id=pb.phone_table.id) " \       "left join pb.email_table on (pb.name_table.id=pb.email_table.id) " \    "union select * name_table " \<br>       "left join phone_table on (name_table.id=phone_table.id) " \       "left join email_table on (name_table.id=email_table.id);"; 

if changes in table, have recreate temporary table.
increasing amount of data, creating temporary table takes time, since i'm having continuous read access table, idea follows:

  1. create thread, creates second temp table in background
  2. block access reading clients
  3. drop first temp table
  4. rename second temp table

the problem now: creating temporary table write access database, blocks automatically reading threads also.

has idea how can handle this? need read access while recreating temporary table.

as long threads part of same program, have control on database connections. can write data in separate database, , attach later.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -