SQLite Forum

suggest:for geopoly,advice to add primary key like rtree
Login
rtree's struct like this:
CREATE VIRTUAL TABLE demo_index USING rtree(
   id,              -- Integer primary key
   minX, maxX,      -- Minimum and maximum X coordinate
   minY, maxY       -- Minimum and maximum Y coordinate
);
and we can insert other info in another table like below:
CREATE TABLE demo_data(
  id INTEGER PRIMARY KEY,  -- primary key
  objname TEXT,            -- name of the object
  objtype TEXT,            -- object type
  boundary BLOB            -- detailed boundary of object
);

this is very good!

but for geopoly,the table ddl is like this, 
CREATE VIRTUAL TABLE newtab USING geopoly(a,b,c);
and I can't add a primary key for query quickly.

my geopoly tbl is :
CREATE VIRTUAL TABLE
 IF NOT EXISTS path_index USING geopoly
(vehicle_id,
begin_time
);

my data tbl is:
CREATE TABLE IF NOT EXISTS pathway
(id         BIGINT PRIMARY KEY UNIQUE NOT NULL,
path        BLOB,
vehicle_id   TEXT,
begin_time   BIGINT,
end_time     BIGINT,
area         DOUBLE,
rect         TEXT,
block_id     BIGINT,
layer_index  TINYINT,
UNIQUE(vehicle_id,begin_time));

could you help me,thanks a lot?