From 15e35062b91e544a07767ca187800d98dbd39586 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Tue, 7 Feb 2017 14:03:11 +0000 Subject: [PATCH] More comments on the choice of JSON storage --- src/github.com/matrix-org/dendrite/roomserver/storage/sql.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/github.com/matrix-org/dendrite/roomserver/storage/sql.go b/src/github.com/matrix-org/dendrite/roomserver/storage/sql.go index d90a5320d..fa8f9d3d5 100644 --- a/src/github.com/matrix-org/dendrite/roomserver/storage/sql.go +++ b/src/github.com/matrix-org/dendrite/roomserver/storage/sql.go @@ -369,7 +369,10 @@ CREATE TABLE IF NOT EXISTS event_json ( event_nid bigint NOT NULL PRIMARY KEY, -- The JSON for the event. -- Stored as TEXT because this should be valid UTF-8. - -- Not stored as a JSONB because we always just pull the entire event. + -- Not stored as a JSONB because we always just pull the entire event + -- so there is no point in postgres parsing it. + -- Not stored as JSON because we already validate the JSON in the server + -- so there is no point in postgres validating it. -- TODO: Should we be compressing the events with Snappy or DEFLATE? event_json text NOT NULL );