-
Notifications
You must be signed in to change notification settings - Fork 3
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
Remove materialized view #579
Closed
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
c13df08
noop the current validator state refresh for now. We're switching to…
dcshock 33e5cc2
change current_validator_state to a normal view
jdfigure 16cb5cf
Merge remote-tracking branch 'refs/remotes/origin/remove-materialized…
dcshock 93c0652
change current_validator_state to a normal view
jdfigure 8e7deba
Merge remote-tracking branch 'origin/remove-materialized-view' into r…
jdfigure e8b89cc
- Add a table to track row counts, and apply a trigger to the tx_cach…
dcshock 84d8de8
create/ignore or replace to avoid conflicts if we shove this into th…
dcshock c04712e
Merge remote-tracking branch 'refs/remotes/origin/remove-materialized…
dcshock 353f500
- Ignore this one for now..
dcshock 45d2aae
- Add caching for recent blocks and txs
dcshock ce761d2
updating most cron jobs to run with delay of 5 mins
arnabmitra 277a222
- brute force logging
dcshock 873564f
- noop the gov tx controller fetch for now.
dcshock 2577dc3
reverting scheduler changes.
arnabmitra 2fbc1fc
reverting scheduler changes.
arnabmitra a3a642a
add subquery to primary tx query to prevent sorting until after disti…
jdfigure 04e3d81
- Allow the tx query for validator gov proposals to run again now tha…
dcshock 9e096e0
Merge remote-tracking branch 'refs/remotes/origin/remove-materialized…
dcshock fca2f7c
tweak subquery alias to match orderBy expression
jdfigure a8a4c82
fix linting issues
nullpointer0x00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
database/src/main/resources/db/migration/V1_97__Update_validator_state_view.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
SELECT 'Modify `current_validator_state` view' AS comment; | ||
DROP MATERIALIZED VIEW IF EXISTS current_validator_state; | ||
|
||
CREATE VIEW current_validator_state AS | ||
SELECT DISTINCT ON (vs.operator_addr_id) vs.operator_addr_id, | ||
vs.operator_address, | ||
vs.block_height, | ||
vs.moniker, | ||
vs.status, | ||
vs.jailed, | ||
vs.token_count, | ||
vs.json, | ||
svc.account_address, | ||
svc.consensus_address, | ||
svc.consensus_pubkey, | ||
vs.commission_rate, | ||
vs.removed, | ||
ai.image_url | ||
FROM validator_state vs | ||
JOIN staking_validator_cache svc on vs.operator_addr_id = svc.id | ||
LEFT JOIN address_image ai ON svc.operator_address = ai.address | ||
ORDER BY vs.operator_addr_id, vs.block_height desc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
service/src/main/kotlin/io/provenance/explorer/config/CacheConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import org.springframework.cache.CacheManager | ||
import org.springframework.cache.annotation.EnableCaching | ||
import org.springframework.cache.caffeine.CaffeineCacheManager | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.context.annotation.Configuration | ||
import java.util.concurrent.TimeUnit | ||
|
||
@Configuration | ||
@EnableCaching | ||
class CacheConfig { | ||
@Bean | ||
fun cacheManager(): CacheManager { | ||
val cacheManager = CaffeineCacheManager("responses") | ||
cacheManager.setCaffeine( | ||
com.github.benmanes.caffeine.cache.Caffeine.newBuilder() | ||
.expireAfterWrite(30, TimeUnit.SECONDS) // Cache expires after 10 seconds | ||
.maximumSize(100) | ||
) // Optional, limits the number of cached items | ||
return cacheManager | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: comment should be deleted or match parameter.