Sqlite slow but barely using machine ressources -


i have 500mb sqlite database of 5 million rows following schema:

create table my_table (         id1 varchar(12) not null,         id2 varchar(3) not null,         date date not null,         val1 numeric,         val2 numeric,         val2 numeric,         val4 numeric,         val5 integer,         primary key (id1, id2, date) ); 

i trying run:

select count(rowid) my_table 

the query has been running several minutes seems excessive me. aware sqlite not optimized count(*)-type queries.

i accept if @ least machine appeared hard @ work. however, cpu load hovers somewhere around 0-1%. "disk delta total bytes" in process explorer 500.000.

any idea if can sped up?

you should have index fields query on this. create index tags_index on tags(tag);. then, sure query faster. secondly, try normalize table , have test (without having index). compare results.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -