when are indexes used?

Поиск
Список
Период
Сортировка
От InfraRED
Тема when are indexes used?
Дата
Msg-id 37E500CA.3FF5DB37@a-b.hu
обсуждение исходный текст
Список pgsql-general
I noticed that indexes are not used sometimes when they could speed up
queries:

explain select * from auth where uid=30;
        Index Scan using auth_uid_key on auth  (cost=2.05 rows=1 width=40)

explain select * from auth where uid<30;
        Seq Scan on auth  (cost=2.06 rows=11 width=40)

explain select * from auth order by uid;
        Sort  (cost=2.06 rows=32 width=40)
          ->  Seq Scan on auth  (cost=2.06 rows=32 width=40)

are there any ways to speed up queries like these?
the exact usage alg. of indexes is documented somewhere?
when is this going to be fixed?


finally some enhancement ideas:

persistent views: like select into, but the view gets updated every time
the table(s) it was created from change. (gives no further functionality
over views, but when used wisely, can speed up things)

pertable fsync behaviour

inmemory tables:  table data should not be saved to disk (maybe except
for swapping), because contains rapidly changing data, which would
expire before restarting the backend

ps: sorry for my bad english

--
InfraRED of aurora-borealis/Veres Tibor
E-Mail: infrared@a-b.hu

В списке pgsql-general по дате отправления:

Предыдущее
От: Naceur
Дата:
Сообщение: (no subject)
Следующее
От: Martin Weinberg
Дата:
Сообщение: Memory exhausted in AllocSetAlloc()