Drop index using psycopg2 takes effect before or after commit?

I am making a python script to insert some data into a postgresql database.

Following the postgresql documentation to speed up the loading process, my script has this structure

  • Connect to database and create cursor
  • Drop all indexes
  • Download all data with the copy command
  • Recover All Indexes
  • Commit and close cursor and join (only commit as a whole script)

So my question is: does the index throw before commit, what does it have any effect in terms of speeding up loading or not?

+4
source share
1

commit .

, , , .

docs , :

, , , . , .. , , , , .

, , ( ) .

, :

, , , .

, . , , (, , ), .

+1

Source: https://habr.com/ru/post/1680704/


All Articles