Re: test / live environment, major performance difference
| От | Michael Glaesemann |
|---|---|
| Тема | Re: test / live environment, major performance difference |
| Дата | |
| Msg-id | 6336D034-24D7-47B3-8690-9E7561E5432C@seespotcode.net обсуждение исходный текст |
| Ответ на | Re: test / live environment, major performance difference (Christo Du Preez <christo@mecola.com>) |
| Список | pgsql-performance |
On Jun 12, 2007, at 8:32 , Christo Du Preez wrote: > I have noticed that my server never uses indexing. No matter what I > do. > > As an example I took a table with about 650 rows, having a parentid > field with an index on parentid. > > EXPLAIN ANALYZE > SELECT * > FROM layertype > where parentid = 300; The planner weighs the cost of the different access methods and choses the one that it believes is lowest in cost. An index scan is not always faster than a sequential scan. With so few rows, it's probably faster for the server to read the whole table rather than reading the index and looking up the corresponding row. If you want to test this, you can set enable_seqscan to false and try running your query again. http://www.postgresql.org/docs/8.2/interactive/runtime-config- query.html#RUNTIME-CONFIG-QUERY-ENABLE Michael Glaesemann grzm seespotcode net
В списке pgsql-performance по дате отправления: