Re: INSERT performance deteriorates quickly during a large import
| От | Tomas Vondra |
|---|---|
| Тема | Re: INSERT performance deteriorates quickly during a large import |
| Дата | |
| Msg-id | 4734CA4B.3040102@fuzzy.cz обсуждение исходный текст |
| Ответ на | Re: INSERT performance deteriorates quickly during a large import (Chris Browne <cbbrowne@acm.org>) |
| Список | pgsql-general |
>> Try to one of these: >> >> a) don't use INSERT statements, use a COPY instead >> >> b) from time to time run ANALYZE on the "public" table (say 1000 >> inserts, then one analyze) >> >> c) create the table without constraints (primary / foreign keys in this >> case), import all the data, and then create the constraints >> >> The (b) and (c) may be combined, i.e. import without constraints and >> analyze from time to time. I'd probably try the (a) at first, anyway. >> >> Try to gather some more statistics - is the problem related to CPU or >> I/O? Use 'dstat' for example - this might say give you a hint in case >> the advices mentioned above don't help. > > I agree with all but b). You're right - this combination (no constraints or indices and using ANALYZE at the same time) won't help. The original list of advices was a little bit different, but I've changed it and haven't checked the following paragraphs ... Tomas
В списке pgsql-general по дате отправления: