Hi,

I'm designing a schema for storing route info in a H2 database.
A route consists of metadata as well as a sequence of coordinates (from 
hundreds to thousands of coordinate pairs).
>From a modelling and performance perspective what would be the recommended 
way to store the data?
Using a normalised database schema or packing the coordinates in H2 ARRAY 
elements?
Once a route is created, waypoints associated with it are never updated, 
but other metadata will be.

CREATE TABLE route (
  id IDENTITY,
  name VARCHAR(50)
);

CREATE TABLE waypoint (
  route_id BIGINT,
  lat DOUBLE NOT NULL,
  lon DOUBLE NOT NULL,
  timestamp BIGINT,
  FOREIGN KEY (route_id) REFERENCES route(id)
);

or

CREATE TABLE route2 (
  id IDENTITY,
  name VARCHAR(50),
  waypoints ARRAY
);


-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/3709fc1c-c9a2-429f-9599-ee3825ed6041%40googlegroups.com.

Reply via email to