does using PV and pipe affect perfomance importing database?



  • I'm importing a database that's almost 2.5 GB inside a docker postgres container. I wanted to know the stimated time and the progress so to check the progress I use PV command like this (I'm not sure if it's the best option)

    pv mydb.sql | docker exec -i containerName psql -U postgres -d databaseName
    

    I notice that the performance is really low, so my question is if you guys think that the PIPE that I use with PV command could make the performance of the restore worse. Because I normally used to restore the database like this

    docker exec -i containerName psql -U postgres -d databaseName < mydb.sql
    

    and it wasn't that slow before (But I couldn't check the progress), so I'm not sure if it's only my perception or it really may degrade the performance.

    This is the performance that PV shows (I'm not sure if that "1:11:33:00" means 1 hour 11 minutes and 33 seconds)

    enter image description here



  • create index statement in SQL is only a few bytes long, but it takes a significant amount of resources to actually complete. Same thing for constraints, matviews. It is not possible to view the progress correctly by tracking the read position of the file.

    There is no easy way to track overall progress.

    use with PV command could make the performance of the restore worse

    At the level of measurement error.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2