Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apidata: store completed candles in db #2443

Merged
merged 4 commits into from
Oct 30, 2023
Merged

Conversation

buck54321
Copy link
Member

Resolves #2315.

Comment on lines 80 to 84
InsertCandle = `INSERT INTO %s (end_stamp, candle_dur, match_volume,
quote_volume, high_rate, low_rate, start_rate, end_rate
)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8);`
// How to ON CONFLICT (end_stamp, candle_dur) DO NOTHING ?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really sure yet how to get this to work. If I try this ON CONFLICT clause, I get a db error

[ERR] MKT: Error updating API data collector: pq: there is no unique or exclusion constraint matching the ON CONFLICT specification

Or maybe the two-column index isn't worth it. The PostgreSQL docs say to use multi-column indexes sparingly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just have three tables, one for each candle duration?

@buck54321 buck54321 marked this pull request as ready for review October 3, 2023 15:26
@buck54321 buck54321 merged commit 6a12553 into decred:master Oct 30, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

server: concurrent data api loading
3 participants