"Brannon King" <[EMAIL PROTECTED]> wrote:
> The statement
> CREATE UNIQUE INDEX primkey ON 4dData (x,y,z)
> is too slow for me.
> 
> Is there some way I can create that unique index without the overhead of
> uniqueness checking? I know all my triples are unique when used =
> together: I
> generated them that way. Or is there some other way I can create that =
> index
> faster?
> 

The following technique is unsupported.  It might change
or go away in a subsequent release.  It might not work.
It might corrupt your database.  Use with extreme caution.

  (1)  CREATE INDEX primkey ON data(x,y,z)
  (2)  PRAMGA writable_schema=ON
  (3)  UPDATE sqlite_master 
          SET sql='CREATE UNIQUE INDEX primkey ON data(x,y,z)'
        WHERE name='primkey'
  (4)  close and reopen the database connection

The above technique is unsupported.  It might not work.
It might corrupt your database.  The overhead of the
uniqueness check is not that much so it is unlikely
to help much anyway.  You have been warned.

--
D. Richard Hipp   <[EMAIL PROTECTED]>

Reply via email to