2

I'm facing a problem with SQLite and I need some help. I'm developing an application in C# .NET with SQLite precompiled dlls. The versions that I use is "1.0.66.0" for x86 and "1.0.79.0" for x64 processor.

I use the following command to get some results

*using (DbDataReader reader = _database.ExecuteQuery(selectCommand))*

The scenarios are the following:

#1 I build the exe with Platform target:x64 and load the x64 version of SQLite In this case the ExecuteQuery executes the selectCommand and returns the results (37 rows) in 1 second.

#2 I build the exe with Platform target:x86 and load the x86 version of SQLite In this case the ExecuteQuery executes the selectCommand and returns the results (37 rows) in 55 seconds.

It's very weird because the code is exactly the same and the only thing that changes is the sqlite dll in order to run in both types of processors.

Any thoughts how to troubleshoot this issue?

PS. When I run the same command on the database manually returns the data in 1 second.

m.stef
  • 21
  • 2
  • What version of SQLite are you using in the three cases? (try `SELECT sqlite_version()`) – CL. Sep 05 '13 at 13:54
  • @CL -My SQLite version is 3.7.6.1 – m.stef Sep 05 '13 at 15:10
  • @CL - The cases are two and I use the same version in both cases. If you mean the versions of dlls are "1.0.66.0" for x86 and "1.0.79.0" for x64. Thanks – m.stef Sep 06 '13 at 06:55
  • According to the [documentation](http://system.data.sqlite.org/index.html/doc/trunk/www/news.wiki), neither of your DLLs uses version 3.7.6.1. And the third case is whatever tool you used to run the command manually. Anyway, the updated query optimizer in the newer SQLite version in the x64 DLL would explain the difference. – CL. Sep 06 '13 at 07:09

1 Answers1

-1

x64 version uses greater virtual space while the query is executed than x86 version. So, the execution time for x86 platform is larger than x64 and the only way to minimize it is to add indexes to the query's tables.

Stathis Andronikos
  • 1,259
  • 2
  • 25
  • 44