>  I was wondering why the JDBC driver for sqlite is so terribly slow.
>  When I execute the following query it takes me around 3 minutes to
>  execute it in Java. If I execute the same query on the command line of
>  sqlite it takes around 1 second.
>
>  Whether I use the native version (0.42) or the pure java version
>  (nested-v042) does not matter much.

I cannot reproduce this at all. Here is a grouping query on a join
with a subselect in the having clause (just like your query), running
on half a million rows:

$ time sqlite3 dbsssim.db < test.query
...
real    0m1.933s
user    0m1.732s
sys     0m0.161s

Here's the same query using the native Java:

$ time java -cp .:sqlitejdbc-v042-native.jar -Djava.library.path=. Test
got 4676 rows

real    0m2.331s
user    0m1.945s
sys     0m0.209s

And again with the nested driver:

 time java -cp .:sqlitejdbc-v042-nested.jar Test
got 4676 rows

real    0m2.231s
user    0m1.953s
sys     0m0.214s

(I am amazed it's keeping up so well with the native.)

The exact Java being used is:

public class Test {
    public static void main(String[] args) throws Exception {
        Class.forName("org.sqlite.JDBC");
        Connection conn = DriverManager.getConnection("jdbc:sqlite:dbsssim.db");
        PreparedStatement stat = conn.prepareStatement(test.query);

        ResultSet rs = stat.executeQuery();
        int i =0;
        while (rs.next())
            i++;
        System.out.println("got "+i+" rows");
    }
}

I don't think the SQL or the JDBC driver is your problem. Three
minutes is catastrophically slow. Try another setup.

d.

--~--~---------~--~----~------------~-------~--~----~
Mailing List: http://groups.google.com/group/sqlitejdbc?hl=en
To unsubscribe, send email to [EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---

Reply via email to