korasoglu Posted March 29, 2020 Share Posted March 29, 2020 (edited) Arkadaşlar SQlite ile aşağıdaki kodla Beş Milyon satırı 15 saniyede yazdırdım (Pc den Pc ye değişir) ama çekme işlemi çok yavaş oluyor veriyi hızlı bir şekilde çekme işlemini nasıl yapabilirim. SQLiteConnection con; SQLiteCommand cmd; con = new SQLiteConnection("Data Source=OrnekVt.sqlite;Version=3;"); string sql = @"CREATE TABLE IF NOT EXISTS Ogrenci( OgrNo INTEGER PRIMARY KEY AUTOINCREMENT , Ad TEXT NOT NULL, Soyad TEXT NOT NULL );"; con.Open(); cmd = new SQLiteCommand(sql, con); cmd.ExecuteNonQuery(); var stopwatch = new Stopwatch(); stopwatch.Start(); cmd = new SQLiteCommand(); using (cmd = new SQLiteCommand(con)) { using (var transaction = con.BeginTransaction()) { for (var i = 0; i < 5000000; i++) { cmd.CommandText = "insert into Ogrenci(Ad,Soyad) values ('Ali','Bak')"; cmd.ExecuteNonQuery(); } transaction.Commit(); } } MessageBox.Show(string.Format("{0} saniye sürdü", stopwatch.Elapsed.TotalSeconds)); con.Close(); NOT : Aynı işlemi sql server ile tekrarladım veri çekme hızı yine düşük oldu. Çok büyük projelerde veri işleyenler nasıl bir yol takip ediyor çok merak ettim. Edited March 29, 2020 by korasoglu Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.