Search Postgresql Archives

Array index not used for query on first element?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It seemed reasonable to me that a select on the first element of an array column could use an index on the column, but, as seen in this example, I can't get it to do so:

=> create temp table tempPaths (path int[] primary key);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "temppaths_pkey" for table "temppaths"
CREATE TABLE

=> set enable_seqscan to off;
SET

=> explain select * from temppaths where path[1] = 43;
                                QUERY PLAN
------------------------------------------------------------------------ -- Seq Scan on temppaths (cost=100000000.00..100000022.50 rows=5 width=32)
   Filter: ("path"[1] = 43)
(2 rows)

This is under 7.4. Is this different on less paleolithic versions of PG, or is there some other issue?

Thanks.

- John Burger
  MITRE

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

              http://archives.postgresql.org/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux