Skip to content

Commit

Permalink
Optimize account_asset Index for improved performance (#851)
Browse files Browse the repository at this point in the history
* bump version 3.8.4

* Adjust indexe

account_asset

* new namiing for the files

* Small change for postgres

* update index name postgres

* Anpassung SQLite

* Update conf small changes

---------

Co-authored-by: ohager <[email protected]>
  • Loading branch information
frankTheTank72 and ohager authored Jan 1, 2025
1 parent 15dd35d commit 306d4cf
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 64 deletions.
122 changes: 58 additions & 64 deletions conf/node-default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
# node.cashBackId = 8952122635653861124

#### DATABASE SECTION ####
##########################

## Maximum allowed connections by Database connection pool
# DB.Connections = 30
Expand Down Expand Up @@ -58,7 +59,61 @@
# DB.Username=signumnode
# DB.Password=s1gn00m_n0d3

#### DATABASE ####
##################

## Enable trimming of derived objects tables.
# DB.trimDerivedTables = on

## If trimming enabled, maintain enough previous height records to allow rollback of at least
## that many blocks. Must be at least 1440 to allow normal fork resolution. After increasing
## this value, a full re-scan needs to be done in order for previously trimmed records to be
## re-created and preserved.
# DB.maxRollback = 1440

## Database default lock timeout in seconds.
# DB.LockTimeout = 60

## Maximum number of rows to be inserted in a single SQL statement.
## Defaults to 10000, should be ok in most situations.
## May be fine tuned according to your DBMS or to your machine performances.
## Warning: a high value (> 15000 rows) is known to generate queries too big for an SQLite backend
# DB.InsertBatchMaxSize = 10000

## Enable the indirect incoming tracker service. This allows you to see transactions where you are paid
## but are not the direct recipient eg. Multi-Outs.
# node.indirectIncomingService.enable = true

## Auto Pop Off means that the node will, when failing to push a block received whilst syncing (from another
## peer), pop off n-1 blocks, where n is the number of failures to push a block at this height.
## This, combined with blacklisting, should significantly lower the chance of your node becoming stuck,
## whilst syncing or when operating normally.
# node.autoPopOff.enable = true


### GPU Acceleration ###
########################

## enable GPU acceleration
# GPU.Acceleration = off
# GPU.AutoDetect = on

## If GPU auto-detection is off (GPU.AutoDetect = off), you must specify manually which one to use
# GPU.PlatformIdx = 0
# GPU.DeviceIdx = 0

## GPU memory usage in percent and how many hashes to process in one batch
# GPU.MemPercent = 50
# GPU.HashesPerBatch = 1000

## number of unverified transactions in cache before GPU verification starts.
# GPU.UnverifiedQueue = 1000

## Uncomment this to limit the number of cpu cores the wallet sees. Default is half available.
# CPU.NumCores = 4

#### PEER 2 PEER NETWORKING ####
################################

## Announce my IP address/hostname to peers and allow them to share it with other peers.
## If disabled, peer networking servlet will not be started at all.
Expand Down Expand Up @@ -206,6 +261,7 @@


#### API SERVER ####
####################

## Accept http/json API requests.

Expand Down Expand Up @@ -303,59 +359,8 @@
## Make sure you configure certbot to renew your certificate automatically so you don't need to worry about it.
# API.SSL_letsencryptPath = /etc/letsencrypt/live/yourdomain.com

#### DATABASE ####



## Enable trimming of derived objects tables.

# DB.trimDerivedTables = on

## If trimming enabled, maintain enough previous height records to allow rollback of at least
## that many blocks. Must be at least 1440 to allow normal fork resolution. After increasing
## this value, a full re-scan needs to be done in order for previously trimmed records to be
## re-created and preserved.

# DB.maxRollback = 1440

## Database default lock timeout in seconds.

# DB.LockTimeout = 60

## Maximum number of rows to be inserted in a single SQL statement.
## Defaults to 10000, should be ok in most situations.
## May be fine tuned according to your DBMS or to your machine performances.
## Warning: a high value (> 15000 rows) is known to generate queries too big for an SQLite backend

# DB.InsertBatchMaxSize = 10000

### GPU Acceleration

## enable GPU acceleration

# GPU.Acceleration = off
# GPU.AutoDetect = on

## If GPU auto-detection is off (GPU.AutoDetect = off), you must specify manually which one to use

# GPU.PlatformIdx = 0
# GPU.DeviceIdx = 0

## GPU memory usage in percent and how many hashes to process in one batch

# GPU.MemPercent = 50
# GPU.HashesPerBatch = 1000

## number of unverified transactions in cache before GPU verification starts.

# GPU.UnverifiedQueue = 1000

## Uncomment this to limit the number of cpu cores the wallet sees. Default is half available.

# CPU.NumCores = 4


#### MINING ####
################

## List of semicolon-separated passphrases to use when solo mining. When mining solo, if you enter your passphrase here,
## you can set your miner to pool mining mode and avoid sending your passphrase over the wire constantly.
Expand All @@ -378,6 +383,7 @@


#### DEVELOPMENT ####
#####################

## (proceed with extreme caution beyond this point)

Expand All @@ -397,7 +403,6 @@

# DEV.forceScan = off


### Debugging (part of Development - isn't it)

## Used for debugging peer to peer communications.
Expand Down Expand Up @@ -428,14 +433,3 @@

# node.shutdownTimeout = 180

## Enable the indirect incoming tracker service. This allows you to see transactions where you are paid
## but are not the direct recipient eg. Multi-Outs.

# node.indirectIncomingService.enable = true

## Auto Pop Off means that the node will, when failing to push a block received whilst syncing (from another
## peer), pop off n-1 blocks, where n is the number of failures to push a block at this height.
## This, combined with blacklisting, should significantly lower the chance of your node becoming stuck,
## whilst syncing or when operating normally.

# node.autoPopOff.enable = true
2 changes: 2 additions & 0 deletions resources/db/migration_mariadb/V12__account_balance_index.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DROP INDEX IF EXISTS account_asset_assetid_idx ON account_asset;
CREATE INDEX IF NOT EXISTS account_asset_assetid_latest_idx ON account_asset (account_id, asset_id, latest);
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DROP INDEX IF EXISTS idx_16404_account_asset_assetid_idx;
CREATE INDEX IF NOT EXISTS idx_16404_account_asset_assetid_latest_idx ON account_asset (account_id, asset_id, latest);
2 changes: 2 additions & 0 deletions resources/db/migration_sqlite/V12__account_balance_index.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DROP INDEX IF EXISTS account_asset_assetid_idx;
CREATE INDEX IF NOT EXISTS account_asset_assetid_latest_idx ON account_asset (account_id, asset_id, latest);

0 comments on commit 306d4cf

Please sign in to comment.