![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm considering the implications of dropping indexes temporarily during mass operations such as imports and generation of sample data. The idea is to avoid unnecessary incremental updates to indexes that aren't used by the mass operation anyway. I'm wondering how this interacts with transactions. Assuming that the import/generation process is the only user of the DB, is it a good idea to do everything, including dropping and creating of the indexes, in a single transaction? Or no transaction at all? |
|
If there are other processes accessing the DB, how are they affected by the dropped indexes? Do they see the indexes as they were before the import/generation transaction started? |
#3
| |||
| |||
|
|
I'm considering the implications of dropping indexes temporarily during mass operations such as imports and generation of sample data. The idea is to avoid unnecessary incremental updates to indexes that aren't used by the mass operation anyway. I'm wondering how this interacts with transactions. Assuming that the import/generation process is the only user of the DB, is it a good idea to do everything, including dropping and creating of the indexes, in a single transaction? Or no transaction at all? |
|
If there are other processes accessing the DB, how are they affected by the dropped indexes? Do they see the indexes as they were before the import/generation transaction started? |
#4
| |||
| |||
|
|
Michael Schuerig <michael (AT) schuerig (DOT) de> wrote: I'm considering the implications of dropping indexes temporarily during mass operations such as imports and generation of sample data. The idea is to avoid unnecessary incremental updates to indexes that aren't used by the mass operation anyway. I'm wondering how this interacts with transactions. Assuming that the import/generation process is the only user of the DB, is it a good idea to do everything, including dropping and creating of the indexes, in a single transaction? Or no transaction at all? Yes, start a transaction, drop the index, insert the data, recreate the index, commit. |
|
If there are other processes accessing the DB, how are they affected by the dropped indexes? Do they see the indexes as they were before the import/generation transaction started? Other transactions can use the index, we have MVCC, yes! |
#5
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |