Re: Table UPDATE is too slow
От | William Yu |
---|---|
Тема | Re: Table UPDATE is too slow |
Дата | |
Msg-id | ch2j5l$uap$1@news.hub.org обсуждение исходный текст |
Ответ на | Re: Table UPDATE is too slow (Ron St-Pierre <rstpierre@syscor.com>) |
Список | pgsql-performance |
Ron St-Pierre wrote: > Yes, I know that it's not a very good idea, however queries are allowed > against all of those columns. One option is to disable some or all of the > indexes when we update, run the update, and recreate the indexes, > however it may slow down user queries. Because there are so many indexes, > it is time consuming to recreate them after the update. Just because a query can run against any column does not mean all columns should be indexed. Take a good look at the column types and their value distribution. Let's say I have a table of addresses but every address I collect is in the 94116 zip code. That would mean indexes on city, state and zip are not only useless but could decrease performance. Also, if a search always includes a unique key (or a column with highly unique values), eliminating the other indexes would force the planner to always use that index first.
В списке pgsql-performance по дате отправления: