Re: avoid lock conflict between SELECT and TRUNCATE
| От | Jim Nasby |
|---|---|
| Тема | Re: avoid lock conflict between SELECT and TRUNCATE |
| Дата | |
| Msg-id | 55F7C2E5.1060304@BlueTreble.com обсуждение исходный текст |
| Ответ на | Re: avoid lock conflict between SELECT and TRUNCATE (Sridhar N Bamandlapally <sridhar.bn1@gmail.com>) |
| Список | pgsql-general |
On 9/11/15 4:50 AM, Sridhar N Bamandlapally wrote: > 1) creating temporary table (say temp_users) on table users with > required data/columns-list and index on column user_id, > ...this will be faster as there will be no joins with other tables > > 2) also need index on table auths_with_trans column user_id > > 3) replacing users with temp_users in BEGIN block That's not really going to help unless the slow part is that you're using a cursor (which is why I don't like them...) FWIW, now that there's better transactional visibility support in the catalogs it might be possible to reduce the lock contention of trunkcate. -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it in Treble! http://BlueTreble.com
В списке pgsql-general по дате отправления: