This is a mapping table or descriptor table or whatever you want to call
it, between 2 tables (about 120,000 rows). I'm finding that operations are
very slow (delete, select, etc.) even within transactions. Foreign keys =
ON. I tried a different design with an integer primary key (which in this
case is a meaningless unused field), and adding UNIQUE([ItemID],
[AttributeID]). Didn't seem to help, probably because all my selects and
deletes didn't use the primary key. Is there anything I can do to speed up
sql commands?


CREATE TABLE [Item_attribute] (
[ItemID] integer NOT NULL,
[AttributeID] integer NOT NULL,
PRIMARY KEY ([ItemID], [AttributeID]),
FOREIGN KEY ([AttributeID])
    REFERENCES [Attribute]([AttributeID]) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY ([ItemID])
    REFERENCES [Item]([ItemID]) ON DELETE CASCADE ON UPDATE CASCADE
)


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to