-- sql/indexes.sql -- This file is part of Decimail; see http://decimail.org -- (C) 2004-5 Philip Endecott -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. drop index messages_by_owner; drop index messages_by_date; drop index messages_by_from_addr; drop index messages_by_rfc822_messageid; drop index messages_by_subject; drop index messages_by_from_addr_domain; drop index messages_by_subject_tsidx; drop index recipients_by_msg_id; drop index recipients_by_addr; begin; create index messages_by_owner on messages ( owner ); create index messages_by_date on messages ( msgdate ); create index messages_by_from_addr on messages ( from_addr ); create index messages_by_rfc822_messageid on messages ( rfc822_messageid ); create index messages_by_subject on messages ( subject ); create index messages_by_from_addr_domain on messages (lower(split_part(from_addr,'@',2))); create index messages_by_subject_tsidx on messages using gist(subject_tsidx); create index recipients_by_msg_id on recipients ( msg_id ); create index recipients_by_addr on recipients ( addr ); end;