Re: schema advice for event stream with tagging and filtering - Mailing list pgsql-general

From Ilya Kazakevich
Subject Re: schema advice for event stream with tagging and filtering
Date
Msg-id 055b01d1f7c2$468df6c0$d3a9e440$@JetBrains.com
Whole thread Raw
In response to schema advice for event stream with tagging and filtering  (Chris Withers <chris@simplistix.co.uk>)
Responses Re: schema advice for event stream with tagging and filtering  (Chris Withers <chris@simplistix.co.uk>)
List 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
andbuild index there to speed-up queries. 

Ilya Kazakevich

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




pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Jsonb extraction very slow
Next
From: Chris Withers
Date:
Subject: Re: schema advice for event stream with tagging and filtering