Hi,

perhaps you could drop the primary key. The query you mentioned,
SELECT count(*) FROM table WHERE column = '%q'
does not utilize it, and if you do execute queries which do, do not 
update the db, and have no other tables, then the primary key serves no 
function.

Martin

Michael Thomason wrote:
> I am doing mobile development, and the size of my application is
> getting too large for comfort.  I'd like to find a way to reduce the
> file size, but maintain the performance.
>
> I have a database that is read only.  It is ordered and each row is
> unique.  It has only one table, which is significantly large.
>
> CREATE TABLE table (column TEXT PRIMARY KEY);
>
> The only query that ever runs against it is as follows:
>
> SELECT count(*) FROM table WHERE column = '%q'
>
> It works fine, it's easy, and it's fast.
>
> The only problem is that the table is very large.  If I list out the
> contents of the table in a text file, it is one-third the size of the
> database.  So, if the text file is 12 MB, the database is 32 MB.
>
> I get the feeling that the database doesn't need to be that large.  It
> seems like that file size is the table size plus two index sizes.  All
> this, when I only really need just an index to tell if the record
> exist.  I never update the record.
>
> Again, what I have now works fine; it's just a large file.
>
> Do you know of a better way to do this in Sqlite3, or a strategy or
> algorithm to do it from text or some data structure?
>
> Cheers!
> Michael
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>   
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to