Hi,

I have a question about the performance of my SQLite DB, where the db-file has about 20MB and which I use in a Java application via the Java wrapper.

This are the relevant parts of the scheme:

create table TABB (B INTEGER,GB INTEGER,G,PRIMARY KEY(B,GB));

create table TABG (G INTEGER PRIMARY KEY,S);

create index G_IDX ON TABG(S);

create index B_IDX ON TABB(G);


TABB has 14785 rows, TABG 7111 rows.
On my PC the following query requires about 53 seconds:
select * from TABG a, TABB b where (a.S='3' or a.S='12 or...) and b.G=a.G order by a.G asc;


(On Oracle with the same scheme and data it requires only 0.4 seconds.)

Second, when my application does a very simliar second query right after that first one, that requires less than 4 seconds.
select * from TABB b, TABG a where (a.S='3' or a.S='12 or...) and a.G=b.G order by b.B asc, b.GB asc;


The times are used only for the query, not connecting etc. I guess it has something to do with building up the data structures for the first query resp. caching.

Does anybody know if that is the performance I should expect?
Does anybody has some hints on how to improve this bit of the db scheme?

Thanks in advance,
  Bo


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to