-
Notifications
You must be signed in to change notification settings - Fork 129
Closed
Milestone
Description
CockroachDB support should be a new feature for 5.0.
I'm fairly certain this is doable since CockroachDB is largely compatible with PostgreSQL, and github.com/lib/pq
seems to support CockroachDB (see this recent pq PR).
However, there are a number of required changes, including:
- removal of custom types (e.g.
vin_t
) since cockroach does not support them. CockroachDB support #1294 - Detecting use of cockroach. CockroachDB support #1294
- Not erroring out when checking postgresql-specific information (e.g.
synchronous_commit
and almost all the pg_settings dumped in the table at startup). CockroachDB support #1294 - Changing the versioning scheme since table comments are not supported in CockroachDB. This has been planned for sometime anyway, but it has to be done for cockroach support. Resolved by dcrpg: meta table versioning #1292
- Updating docs (some PostgreSQL syntax is not supported, such as
CREATE DATABASE dcrdata OWNER dcrdata
.) https://github.com/decred/dcrdata/wiki/CockroachDB -
SERIAL
in CockroachDB does not create a sequence (by default). CockroachDB support #1294 -
DELETE
in CockroachDB does not support theUSING
clause (like aJOIN
). https://www.cockroachlabs.com/docs/stable/delete.html CockroachDB support #1294 - Empty arrays made using the
ARRAY[]
constructor in CockroachDB require type annotation (e.g.ARRAY[]:::BIGINT[]
with three:
characters for annotation instead of conversion), a concept that does not exist in PostgreSQL). May need to use the literal format likeSELECT '{}'::int[];
or whatever works for both PostgreSQL and CockroachDB. CockroachDB support #1294 -
unknown function: cardinality()
forRetrieveUTXOs
CockroachDB support #1294 - Deleting duplicate rows using most common methods fails to due to CRDB memory use. CockroachDB support #1294
- A faster solution for deleting duplicates is needed. CockroachDB support #1294 makes a new temporary table using the distinct rows from the unindexed vins and vouts tables. This is incredibly slow.
- Dropping a unique index that is used for a constrain on an existing table requires the
CASCADE
clause. CockroachDB support #1294 - Slow INSERT. Performance is about 1/5 of PostgreSQL. Tried multi-line inserts
https://www.cockroachlabs.com/docs/stable/performance-best-practices-overview.html
to no avail: https://github.com/decred/dcrdata/compare/3625acdcd48121bfe5b80c45a7fb7710cf6bdd40...chappjc:multi-line-inserts?expand=1
These changes are just what I can come up with now, so it is very likely that there will be many more roadblocks along the way.
Metadata
Metadata
Assignees
Labels
No labels