Re: PostgreSQL versus MySQL for GPS Data

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: Juan Pereira <juankarlos(dot)openggd(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL versus MySQL for GPS Data
Date: 2009-03-17 13:18:37
Message-ID: b42b73150903170618n1a97ba6hdfe5adb594f83183@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy pgsql-general

On Tue, Mar 17, 2009 at 7:47 AM, Craig Ringer
<craig(at)postnewspapers(dot)com(dot)au> wrote:
> Juan Pereira wrote:
>
>
>> - The database also should create a table for every truck -around 100
>> trucks-.
>
> Why?
>
> That's a rather clumsy design that makes it really hard to get aggregate
> data across the fleet or do many interesting queries.
>
> You're almost always better off using a single table with a composite
> primary key like (truckid, datapointid) or whatever. If you'll be doing
> lots of queries that focus on individual vehicles and expect performance
> issues then you could partition the table by truckid, so you actually do
> land up with one table per truck, but transparently accessible via table
> inheritance so you can still query them all together.
>
> Read up on PostgreSQL's table partitioning features.

If there is little/no reason to span queries over various trucks, then
the OP's approach is ok, better than standard TP even. I agree though
that a single table approach is best unless 1) the table has to scale
to really, really large sizes or 2) there is a lot of churn on the
data (lots of bulk inserts and deletes).

merlin

In response to

Responses

Browse pgsql-advocacy by date

  From Date Subject
Next Message Stephen Frost 2009-03-17 13:56:14 Re: PostgreSQL versus MySQL for GPS Data
Previous Message Craig Ringer 2009-03-17 11:47:29 Re: PostgreSQL versus MySQL for GPS Data

Browse pgsql-general by date

  From Date Subject
Next Message Tino Wildenhain 2009-03-17 13:26:41 Re: Uploading data to postgresql database
Previous Message Alvaro Herrera 2009-03-17 13:16:39 Re: What are the benefits of using a clustered index?