Re: schema advice for event stream with tagging and filtering

From: "Ilya Kazakevich" <Ilya(dot)Kazakevich(at)JetBrains(dot)com>
To: "'Chris Withers'" <chris(at)simplistix(dot)co(dot)uk>, "'Postgresql General'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: schema advice for event stream with tagging and filtering
Date: 2016-08-16 13:29:54
Message-ID: 055b01d1f7c2$468df6c0$d3a9e440$@JetBrains.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

>An event is a row with a primary key along the lines of (colo, host,
>category) and an associated set of tags, where each tag has a type and a value
>(eg: {"color": "red", "owner": "fred", "status": "open"...}).

What about simple table with several columns and hstore field for tags?
You may also normalize it (move hosts and categories to separate table).

indexes should help you with fast filtering, or you may load data from this table to denormalized olap table once a day and build index there to speed-up queries.

Ilya Kazakevich

JetBrains
http://www.jetbrains.com
The Drive to Develop

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Withers 2016-08-16 13:37:56 Re: schema advice for event stream with tagging and filtering
Previous Message Merlin Moncure 2016-08-16 13:29:52 Re: Jsonb extraction very slow