Bertrand Mansion wrote: > Hi, > > Could someone please explain me how temporary indexes work ? > > I have tried the query "CREATE TEMP INDEX tmpidx ON table(field)" without > success. Same thing if the table is also temporary itself. Same thing with > TEMPORARY UNIQUE indexes and same thing when I use TEMP instead of > TEMPORARY. > > The error I get is : 'near "INDEX": syntax error' > The query works fine when I remove TEMP. > > Is this feature disabled ? Do I have to enable it at compile time ? > > I am using 2.8.11 on Mac OS X. >
The idea of a TEMP INDEX was added in a fit of stupidity sometime around version 2.8.1. (See check-in [883]) Sometime later, I realized that TEMP INDEXes are a dumb idea and so it was removed for vesion 2.8.7. (See check-in [1122].)
Why are TEMP INDEXes a bad idea? Suppose two processes are looking at the same database. Call theses processes A and B. Suppose the database contains a table X. Suppose A creates a TEMP INDEX on X. The temp index can only be seen by A. It is not visible to B. So if B goes and modifies table X, it does not update the index because it does not even know the index is there. Only A knows about the index. This means that the index is now out-of-date. If A tries to use the index, the wrong answer might be generated.
-- D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]