ExecuteQuery command in SQLite x86 runs very slow

199 Views Asked by At

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.

1

There are 1 best solutions below

1
On

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.