Re: Planner ignoring to use INDEX SCAN
От | Will |
---|---|
Тема | Re: Planner ignoring to use INDEX SCAN |
Дата | |
Msg-id | 3e08969c-5646-416f-98b8-0b43375e6b97@e25g2000prg.googlegroups.com обсуждение исходный текст |
Ответ на | Re: Planner ignoring to use INDEX SCAN (Richard Huxton <dev@archonet.com>) |
Список | pgsql-general |
Hi - been having a few problems like this myself. It's probably a locale thing. Here's at one of your problems: -> Seq Scan on sms_new (cost=0.00..5240444.80 rows=138939341 width=8) Filter: ((otid)::text !~~ 'ERROR%'::text) I assume you have an index on sms_new? Check the locale your database cluster has been set up with: SHOW lc_ctype if it doesn't come back with "C" as your locale, then you will have to make sure your indexes are created as follows: CREATE INDEX IDX_sms_new ON YOUR_TABLE USING btree (sms_new varchar_pattern_ops); Look at chapter 11.8 - Operator Classes for an explanation. Unfortunately you'll need a second index if you want to use a non- pattern matching operator, e.g. =. If your locale is C, then I don't know what the problem is. Hope that helps. Will Temperley
В списке pgsql-general по дате отправления: