-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpg_schema.sql
More file actions
25 lines (25 loc) · 752 Bytes
/
pg_schema.sql
File metadata and controls
25 lines (25 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
-- Schema for the PostgreSQL version of the experiment
-- As date/time is not used, we don't need to convert it to a better format.
BEGIN TRANSACTION;
DROP TABLE IF EXISTS trackpoint_no_index;
DROP TABLE IF EXISTS trackpoint_indexed;
-- Unindexed version
CREATE TABLE trackpoint_no_index (
tp_id SERIAL PRIMARY KEY,
tp_user INTEGER NOT NULL,
tp_point GEOMETRY NOT NULL,
tp_altitude FLOAT,
tp_date VARCHAR(32),
tp_time VARCHAR(32)
);
-- Indexed version
CREATE TABLE trackpoint_indexed (
tp_id SERIAL PRIMARY KEY,
tp_user INTEGER NOT NULL,
tp_point GEOMETRY NOT NULL,
tp_altitude FLOAT,
tp_date VARCHAR(32),
tp_time VARCHAR(32)
);
CREATE INDEX trackpoint_geom_index ON trackpoint_indexed USING GIST (tp_point);
COMMIT TRANSACTION;