| From: | Pailloncy Jean-Gérard <pailloncy(at)gdr-isis(dot)enst(dot)fr> |
|---|---|
| To: | pgsql-performance(at)postgresql(dot)org |
| Subject: | INSERT RULE |
| Date: | 2004-05-03 20:58:28 |
| Message-ID: | A0654D6A-9D44-11D8-971A-000A95DE2550@gdr-isis.enst.fr |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-performance |
Hi,
I test a configuration where one table is divided in 256 sub-table.
And I use a RULE to offer a single view to the data.
For INSERT I have create 256 rules like:
CREATE RULE ndicti_000 AS ON INSERT TO ndict
WHERE (NEW.word_id & 255) = 000 DO INSTEAD
INSERT INTO ndict_000 VALUES( NEW.url_id, 000, NEW.intag);
CREATE RULE ndicti_001 AS ON INSERT TO ndict
WHERE (NEW.word_id & 255) = 001 DO INSTEAD
INSERT INTO ndict_001 VALUES( NEW.url_id, 001, NEW.intag);
And that works, a bit slow.
I try to do:
CREATE RULE ndicti AS ON INSERT TO ndict
DO INSTEAD INSERT INTO 'ndict_' || (NEW.word_id & 255)
VALUES( NEW.url_id, NEW.word_id, NEW.intag);
I got an error on 'ndict_' .
I did not found the right syntax.
Any help is welcomed.
Cordialement,
Jean-Gérard Pailloncy
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Joseph Shraibman | 2004-05-04 02:24:02 | cache table |
| Previous Message | Chris Browne | 2004-05-03 16:38:33 | Re: Recommended File System Configuration |