Re: Effective query for listing flags in use by messages in a folder
От | Hector Vass |
---|---|
Тема | Re: Effective query for listing flags in use by messages in a folder |
Дата | |
Msg-id | 1426680525528.15871@metametrics.co.uk обсуждение исходный текст |
Ответ на | Re: Effective query for listing flags in use by messages in a folder (Andreas Joseph Krogh <andreas@visena.com>) |
Ответы |
Re: Effective query for listing flags in use by messages in a folder
|
Список | pgsql-sql |
do you want to post some insert statements to populate the table message with some realistic example data..
Hector Vass
+44(0)7773 352 559
* Metametrics, International House, 107 Gloucester Road, Malmesbury, Wiltshire, SN16 0AJ
Sent: 18 March 2015 11:59
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] Effective query for listing flags in use by messages in a folder
Andreas ... your code and one of my examples ... I have modified my option 2 to give an example with data that gives you I believe exactly the same output (one row for each flag set for folder_id=3 with the text representation of the flag) ... when you satisfy yourself this produces the same results you might then want to go back and re-read my original post which rather than feeding you verbatim how to produce exactly the same results gave the the pro's and con's of 3x different approaches... I chose to illustrate my option 2 because it is easy to understand and is a reasonable production solution, option 1 was really just to get you thinking differently about how to do this and option 3 I concede was more advanced and probably but requires skills other than plain SQL to implement.
create table message( folder_id integer not NULL,
msg varchar NOT NULL, is_seen boolean NOT NULL default false, is_replied boolean not null default false, is_forwarded boolean not null default false, is_deleted boolean not null default false, is_draft boolean not null default false, is_flagged boolean not null default false
);
Вложения
В списке pgsql-sql по дате отправления: