Search Postgresql Archives

Ignored btree indexes on particular tables.

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

 



Hi all

I've recently installed pg 8.2.5 on a new server and transferred my data from 8.2.4 running on a slow old thing, via pg_dump.

One of these tables has point UK address data, with 27 million rows, and another the UK roads data, approx 4 million rows.

My problem is I have several text fields in the address data, for which postgres ignores the indexes (btree).

Using my pc_ (postcode) column:
Here's the OLD query plan on the old server.

"Index Scan using ap_idx_pc on ap  (cost= 0.00..15.30 rows=1 width=188)"
"  Index Cond: (((pc_)::text >= 'OX2 0'::character varying) AND ((pc_)::text < 'OX2 1'::character varying))"
"  Filter: ((pc_)::text ~~ 'OX2 0%'::text)"

And the NEW:-
"Seq Scan on ap  (cost=0.00..4652339.33 rows=1 width=189)"
"  Filter: ((pc_)::text ~~ 'OX2 0%'::text)"

I have tried :
reindexing.
dropping the index and recreating it.
set enable_seqscan = off;
set seq_page_cost = 1000;
vacuum analyze;
vacuum full;

none of these things have worked.

the strange thing is my btree indexes on the uk roads data work fine.

There are quite a few nulls in the table, but very few in the pc column I've been using as an example.

Any help would be greatly appreciated.

Cheers

Will

[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