John Hansen wrote: > Q: Why not add to the messageblks table fields containing parsed > headers: > > CREATE TABLE dbmail_messageblks ( > messageblk_idnr bigint not null default > nextval('dbmail_messageblk_idnr_seq'::text) PRIMARY KEY, > physmessage_id bigint REFERENCES dbmail_physmessage(id) ON > DELETE CASCADE, > from varchar, > to varchar, > cc varchar, > subject varchar, > received timestamptz, > messageblk text not null, > blocksize bigint not null default (0)::bigint > );
This does not take into accounts many other header fields - and IMAP searches may well include them. As for IMAP fetching, it usually wants "all the headers except some fields", so this won't help it at all. See my reply to Paul for a table solution to that. (Yes it involves three tables, but one could avoid fetching blobs entirely, and all searches except fully body searches will be fast). But Paul is right that the current code probably won't allow this. A rewrite question is up in the air. Yours, Mikhail Ramendik