2008/6/2 Vi <[EMAIL PROTECTED]>: > Bom esse eh o explain; > Onde eu preciso que seja usado o indice esta grifado. > > Limit (cost=8.96..8.97 rows=1 width=18) > -> Aggregate (cost=8.96..8.97 rows=1 width=18) > -> Nested Loop (cost=0.00..8.94 rows=1 width=18) > -> Nested Loop (cost=0.00..6.66 rows=1 width=22) > -> Nested Loop (cost=0.00..6.05 rows=1 width=22) > -> Nested Loop (cost=0.00..5.77 rows=1 > width=18) > -> Index Scan using idx_tvct on tit > (cost=0.00..3.49 rows=1 width=18) > Index Cond: ((tvct = '2008-05-14 > 00:00:00'::timestamp without time zone) AND (tvct <= '2008-07-14 > 00:00:00'::timestamp without time zone)) > Filter: (((tsac)::text = > '70064993000140'::text) AND (tpgt IS NULL)) > -> Index Scan using rdede on rdel > (cost=0.00..2.27 rows=1 width=8) > Index Cond: (t.tctr = rdel.rdelctr) > -> Index Scan using grprrde_grprgrp on grpr > (cost=0.00..0.27 rows=1 width=8) > Index Cond: (rdel.rdelrde = grpr.grprrde) > -> Index Scan using grpgr_pkey on grpgr > (cost=0.00..0.60 rows=1 width=8) > Index Cond: (grpgrrde.grpgrrdegrp = > grpgr.grpgrid) > Filter: (5 = grpgrcsk) > -> Index Scan using csk_pkey on csk (cost=0.00..2.27 rows=1 > width=4) > Index Cond: (cskid = 5)
Do manual (v8.2) [1] : "Indexes are not used for IS NULL clauses by default. The best way to use indexes in such cases is to create a partial index using an IS NULL predicate." [1] http://www.postgresql.org/docs/8.2/static/sql-createindex.html Qual versão está usando ?! Qual a % de nulls na coluna para o numero de registros totais ? Como foi criado o Índice ?! -- Att: Thiago Risso _______________________________________________ pgbr-geral mailing list pgbr-geral@listas.postgresql.org.br https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral