如果我创建一个这样的表:
CREATE TABLE IF NOT EXISTS Tiles
(
X INTEGER NOT NULL,
Y INTEGER NOT NULL,
Zoom INTEGER NOT NULL,
Type INTEGER NOT NULL,
Tile BLOB NULL,
PRIMARY KEY(X, Y,Zoom,Type)
)
我还需要在(X, Y, Zoom, Type)
上添加索引才能快速搜索吗?
我的搜索查询是这样的:
SELECT Tile
FROM Tiles
WHERE X = %1 AND Y = %2 AND Zoom = %3 AND Type = %4
我的插入查询是这样的:
REPLACE INTO Tiles(X, Y, Zoom, Type, Tile)
VALUES(?, ?, ?, ?, ?)