I have a few large DB file (each around 50GB) which contain Images of costumer documents (each pic size around 300KB).
I'm trying to load the pictures into my viewer but it's taking too long, like 1min. Specially for the first query/record.
string query = "select pic from tbl_pictures where record_id = '" + SearchID + "'";
SQLiteConnection con = new SQLiteConnection(conString);
SQLiteCommand cmd = new SQLiteCommand(query, con);
con.Open();
try
{
IDataReader rdr = cmd.ExecuteReader();
try
{
ListOfImagesBytes.Clear();
while (rdr.Read())
{
byte[] a = (System.Byte[])rdr[0];
ListOfImagesBytes.Add((System.Byte[])rdr[0]);
}
}
catch (Exception exc) { MessageBox.Show(exc.Message); }
}
catch (Exception ex) { MessageBox.Show(ex.Message); }
con.Close();
And here is the properties of DB files when I created them:
PRAGMA auto_vacuum = 1;
PRAGMA main.page_size = 4096;
PRAGMA main.locking_mode=NORMAL;
PRAGMA main.synchronous=NORMAL;
PRAGMA main.journal_mode=WAL;
PRAGMA main.cache_size=5000;
PRAGMA main.temp_store=Memory;