• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
SmartHoldem Community

Community

PostgreSQL Database blockchain maintenance/optimize

Scheduled Pinned Locked Moved Blogs
2 Posts 1 Posters 1.5k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • TechnoL0gT Offline
    TechnoL0gT Offline
    TechnoL0g
    wrote on last edited by
    #1

    Why do you need maintenance?
    Over time, the bases in the postgres tend to grow, and begin to move more slowly due to problems with indexing. To solve these problems we use:

    REINDEX - operation of reindexing, fixing damaged indexes in the database.

    VACUUM - garbage collection. VACUUM recovers the space occupied by the "dead" data. When performing normal operations with data, PostgreSQL does not physically remove data from the tables; this happens with the FULL VACUUM operation.

    How to use db maintenance in SmartHoldem Node-A?

    Log into the server
    execute the following commands and wait for the operations to complete, it may take some time

    cd node
    sh stop.sh
    
    psql sth_smartholdem
    REINDEX DATABASE sth_smartholdem;
    vacuum full analyze;
    \q
    
    sh update.sh
    

    Maintenance operations are recommended once a month.

    Эксперт по сверхъестественному в области IT / Expert in the supernatural the IT

    1 Reply Last reply
    4
  • TechnoL0gT Offline
    TechnoL0gT Offline
    TechnoL0g
    wrote on last edited by
    #2

    or Create Script:

    nano reindex.sh
    

    insert

    psql "postgresql://$USER:[email protected]/sth_smartholdem" -c 'REINDEX DATABASE sth_smartholdem'
    psql "postgresql://$USER:[email protected]/sth_smartholdem" -c 'vacuum full analyze'
    

    run

    sh reindex.sh
    

    Эксперт по сверхъестественному в области IT / Expert in the supernatural the IT

    1 Reply Last reply
    1

Decentralized Gaming Platform
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search