> phones=# \d i_pl_pseq
>         Index "i_pl_pseq"
>  Attribute |         Type
> -----------+----------------------
>  entity    | character varying(3)
>  pseq      | bigint
> btree
>
> phones=# explain select * from phonelog where entity = '001' and pseq >=
> 9120 and pseq <= 9123;
> NOTICE:  QUERY PLAN:
>
> Index Scan using i_pl_loadtimestamp on phonelog  (cost=0.00..209247.39
> rows=607 width=137)
>
> EXPLAIN
>
> phones=# \d i_pl_loadtimestamp
>     Index "i_pl_loadtimestamp"
>  Attribute |         Type
> -----------+----------------------
>  entity    | character varying(3)
>  loaddate  | date
>  loadtime  | time
> btree

Just a guess, but what happens if you build i_pl_pseq(pseq, entity), i.e.
reverse the key fields? Also, has the table been vacuum analyzed?

-- Joe




---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to