Re: R: Query plan on identical tables differs . Why ?
От | Stephan Szabo |
---|---|
Тема | Re: R: Query plan on identical tables differs . Why ? |
Дата | |
Msg-id | 20040513080130.E3465@megazone.bigpanda.com обсуждение исходный текст |
Ответ на | R: Query plan on identical tables differs . Why ? ("Fabio Panizzutti" <panizzutti@interlogica.net>) |
Ответы |
R: R: Query plan on identical tables differs . Why ?
|
Список | pgsql-performance |
On Thu, 13 May 2004, Fabio Panizzutti wrote: > I don't understand why the planner chose a different query plan on > identical tables with same indexes . Because it's more than table structure that affects the choice made by the planner. In addition the statistics about the values that are there as well as the estimated size of the table have effects. One way to see is to see what it thinks is best is to remove the indexes it is using and see what plan it gives then, how long it takes and the estimated costs for those plans. In other suggestions, I think having a (tag_id, data_tag) index rather than (data_tag, tag_id) may be a win for queries like this. Also, unless you're doing many select queries by only the first field of the composite index and you're not doing very many insert/update/deletes, you may want to drop the other index on just that field.
В списке pgsql-performance по дате отправления: