RE: [GENERAL] Optimal indicies
| От | Oleg Broytmann |
|---|---|
| Тема | RE: [GENERAL] Optimal indicies |
| Дата | |
| Msg-id | Pine.SOL2.3.96.SK.990418132247.7864A-100000@sun.med.ru обсуждение исходный текст |
| Ответ на | RE: [GENERAL] Optimal indicies ("Jackson, DeJuan" <djackson@cpsgroup.com>) |
| Список | pgsql-general |
Hi!
On Fri, 16 Apr 1999, Jackson, DeJuan wrote:
> try:
> EXPLAIN SELECT pos_id, rating
> FROM pos_rating pr
> WHERE date_i = current_date AND city_id = 2 AND
> EXISTS (SELECT DISTINCT pos_id FROM positions p WHERE subsec_id = 1 AND
> status = 'A' AND pr.pos_id=p.pos_id)
> ORDER BY rating;
This probably will help, thanks.
> Index date_i and city_id only.
Why? How do I find (for any given query) what indices I do need?
Postgres (being just a program) definetely have a set of rules where to use
and where not to use indicies. Any way for us to know/understand these
rules? Any general rules?
> -DEJ
Oleg.
----
Oleg Broytmann http://members.xoom.com/phd2/ phd2@earthling.net
Programmers don't die, they just GOSUB without RETURN.
В списке pgsql-general по дате отправления: