I've started to use rules. Something strange with one of them:
create word_list (id int4, word char(15), count int4 default 0);
create unique index word_list_word_uidx on word_list (word);
(something inserted into word_list)
create table temp (word char(15));
create rule ins_word as on insert to temp do instead update word_list set
count=count+1 where word=new.word;
I'd like to use "temp" relation as some kind of filter; now i could f.e.
import big chunk of
data from text file (import word) with simple "copy", and this should count
words in file
storing results in word_list.count.
And it works, but...
explain update word_list set count=count+1 where word='aix';
shows index scan (using word_list_word_uidx of course)
explain insert into temp (word) values ('aix');
gives seq scan as result.
Relation word_list has about 300 000 tuples, so it's rather boring to w8 1
or 2 s to insert ONE word.
Could i do smth to enforce index scan when using above rule?
BTW. sorry for my english :(
***** I'm not a complete idiot, some parts are missing...
pgsql-general by date
|Next:||From: Albert Chen||Date: 1998-12-17 01:03:52|
|Subject: Why PostgreSQL is better than other commerial softwares?|
|Previous:||From: Oleg Broytmann||Date: 1998-12-16 08:55:46|
|Subject: Re: [GENERAL] Date & Datetime problems|