That's not "good database design", it's relational dogma.  Good database
design involves understand what data needs to be stored and *how it's going
to be accessed*, which John hasn't told us in detail.  If you don't need to
access individual point relationally, and only are going to process entire
polygons, storing them in a blob will be a better solution.

--Ned.
http://nedbatchelder.com

-----Original Message-----
From: Clay Dowling [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 17, 2005 2:28 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] BLOB versus table storage


[EMAIL PROTECTED] said:
> CREATE TABLE polygons (id INTEGER PRIMARY KEY, externalref INTEGER,
> pointcount INTEGER, pointlist BLOB)
>
> When I insert data to this table, I have to write a binary list of x,y
> coordinates in a sequential memory region before storing in the database.
> Getting information back from the database requires a conversion in the
> opposite direction.  Typically these lists contain 10-20 points, so they
> are not very large.
>
> This currently works, but I'm wondering if it would be better to create a
> new table for the points and reference the polygon primary key:

Create the second table.  There shouldn't be any question about this. 
That's just good database design.

Clay Dowling
Opinionated Programmer

-- 
Lazarus Notes from Lazarus Internet Development
http://www.lazarusid.com/notes/
Articles, Reviews and Commentary on web development

Reply via email to