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

Change Postgres to store data in JSON #389

Open
2 of 4 tasks
neongreen opened this issue Aug 23, 2019 · 2 comments · May be fixed by #390
Open
2 of 4 tasks

Change Postgres to store data in JSON #389

neongreen opened this issue Aug 23, 2019 · 2 comments · May be fixed by #390
Assignees
Labels

Comments

@neongreen
Copy link
Member

neongreen commented Aug 23, 2019

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.

@neongreen neongreen changed the title Migrate Postgres to store data in JSON Change Postgres to store data in JSON Aug 23, 2019
@neongreen
Copy link
Member Author

You can use gauge for benchmarking. Using benchmark suites is inconvenient so just add a new command to the CLI.

@neongreen
Copy link
Member Author

The new command should find the biggest category in the current database and then perform the benchmarks.

@willbasky willbasky linked a pull request Aug 29, 2019 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants