User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
adv_sample_user_queries_plus [2016/03/13 23:24]
adv_sample_user_queries_plus [2021/05/15 14:18]
daniel index optimisation
Line 25: Line 25:
 <code sql> <code sql>
 SELECT mail_id FROM mail m SELECT mail_id FROM mail m
-WHERE status&(16+32)=0+WHERE status&32=0 AND status&16 -- intentionally split to benefit from the index on mail.status&​32=0
 AND msg_date<​now()-'​1 month'::​interval AND msg_date<​now()-'​1 month'::​interval
 AND thread_id is not null AND thread_id is not null
adv_sample_user_queries_plus.txt ยท Last modified: 2021/05/15 14:21 by daniel