Skip to content
This repository was archived by the owner on Dec 11, 2019. It is now read-only.
This repository was archived by the owner on Dec 11, 2019. It is now read-only.

Change Postgres to store data in JSON #389

@neongreen

Description

@neongreen

Tables (categories, items, traits) should be compressed into a single categories table:

    CREATE TABLE categories (
      uid text PRIMARY KEY,           -- Unique category ID
      data jsonb NOT NULL
    );
  • Change the schema. (No need to write a migration, just change the v0 schema.)
  • Implement selectCategories, selectCategory, insertCategory, updateCategory.
  • Benchmark how long it takes to execute selectCategories with code compiled with -O on the official database.
  • Benchmark how long it takes to do updateCategory id on the biggest category with code compiled with -O on the official database.

Based on the latter two points we can decide whether we need any fine-grained select/update functions or whether we can get away with simply reading and writing everything all the time.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions