On Thu, 19 Mar 2009 06:38:33 -0700 (PDT), baxy77bax
<b...@hi.htnet.hr> wrote:

>:-D
>
>one more question :
>
>if i create primary key on my table and then import the data (assuming i
>used transactions) will my import be faster or slower vs the case where  i
>import the data first and then create key (foreign key ??) and index the
>table.

That's not a foreign key, it would just be a unique index.

It's hard to guess what would be faster, The best way to
find out would be to test both cases, you can do that
yourself. Make sure you import in sort order of primary key
and use large transactions (BEGIN / COMMIT).

>the point is that i need my import to be faster. i have 3890660 rows to
>import and row van be up to 50M large, so it's taking a pretty long time

Optimize for your use case:

PRAGMA page_size
PRAGMA default_cache_size and cache_size
PRAGMA synchronous=off (only during loading)

By the way, INTEGER PRIMARY KEY is faster than a TEXT column
(VARCHAR is also TEXT) as primary key.

>thnx
-- 
  (  Kees Nuyt
  )
c[_]
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to