0

I'm developping a C# project with SqlServerCompact.

I have to open a connection with the database for each request and create a reader/executenonquery. But is it possible to load all the database in the memory ? (sqllite did this in c++ as far as i can remember). This would allow me to avoid huge loading times on each request.

I'd like to do all my request in the memory and after persist them in the .sdf file. Is it possible with sql server compact ? If not which database manager will you recommend me ? (I need something which can be deployed easily)

I ask the question because sometimes I have huge insert to realize (between 6000 and 10000) in one time, so it takes ages, do you have ideas on how to improve these performances ?

Thank you

user2088807
  • 1,378
  • 2
  • 25
  • 47
  • I don't use SQL Server compact but between 6,000 and 10,000 rows definitely does not strike me as "huge". Perhaps show the slow code and give details about timings and ask why it is so slow? Also I'm not sure how loading unrelated rows in memory would be expected to help your insert performance? – Martin Smith Feb 06 '14 at 11:49
  • Thank you for your answer. I use a simple : IDbCommand Insert = new SqlCeCommand("INSERT INTO table", connection); Insert.ExecuteNonQuery(); Would you recommend me sqllite or Sql CE for performance ? Ithought maybe if everything was loaded in RAM a background thread would assure the modifications into the database file while the first thread would just insert a new value into RAM. – user2088807 Feb 10 '14 at 15:15

0 Answers0