Performance Killer 'IN' ?
От | Kai Hessing |
---|---|
Тема | Performance Killer 'IN' ? |
Дата | |
Msg-id | 492752FmfdpeU1@individual.net обсуждение исходный текст |
Ответы |
Re: Performance Killer 'IN' ?
|
Список | pgsql-general |
Hossa, I just made a little test on our test-database. I have an excel sheet with about 2000 entries that should be updated with the same value. In a first try I generated an SQL-Syntax for every entry like: UPDATE xyz SET status=-6 WHERE id=xyz1 AND status>-1; UPDATE xyz SET status=-6 WHERE id=xyz2 AND status>-1; UPDATE xyz SET status=-6 WHERE id=... AND status>-1; The execution of the ~2000 SQL-commands took about 5-10 seconds. Then I tried the same with generating only one request using IN with the twothousand entries like: UPDATE xyz WHERE id IN (xyz1, xyz2, ....) AND status>-1; and it took about 10 Minutes to execute. So it is nearly a hundred times slower. Can this be verified? Is there anything that can be done about that? Else I would need to have a few words with our programmers... By the way the testsystem is a basic Suse 9.3 with a default postgres installation 8.0.x Thanks and *greets* Kai
В списке pgsql-general по дате отправления: