| От | Tom Lane |
|---|---|
| Тема | Re: DELETE SQL too slow. |
| Дата | |
| Msg-id | 6017.1031063713@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | DELETE SQL too slow. (Diogo Biazus <diogo@ikono.com.br>) |
| Список | pgsql-general |
Diogo Biazus <diogo@ikono.com.br> writes:
> I'm having problems with delete commands in postgres. They are too slow.
> I'm trying to delete a set o 300 rows in table with 50000 rows with a
> simple command like:
> DELETE FROM table WHERE field1 = '4'
> When I run the explain it tells me that index_scan is being used. But to
> complete the delete it takes more than 30 minutes and the CPU use never
> rise above 10%.
I'm betting this table is referenced by foreign key constraints on other
tables, and you are missing some needed indexes on those other tables.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера