postgres a indexy

Vladimir Naprstek vladimir.naprstek na scplyn.cz
Pondělí Únor 17 16:11:04 CET 2003


proc mi postgres nepouzije indexy pro group by dotazu? nebo musim
vytvorit specialne index tak, aby byl pouzit pri group by?

alespon tak jsem pochopil explain:

# explain select component from data group by component;
NOTICE:  QUERY PLAN:

Group  (cost=284657.94..288625.92 rows=158719 width=8)
    ->  Sort  (cost=284657.94..284657.94 rows=1587190 width=8)
          ->  Seq Scan on data  (cost=0.00..34192.90 rows=1587190 width=8)

EXPLAIN

Na ten sloupec mam index:
# \d data_component;
        Index "data_component"
    Column   |         Type
-----------+----------------------
   component | character varying(4)
btree


-- 
Vladimír Náprstek
Severočeská plynárenská, a.s.
tel: 475 233 102
mail: vladimir.naprstek na scplyn.cz




Další informace o konferenci Test