Re: Optimize query for listing un-read messages

From: Andreas Joseph Krogh <andreas(at)visena(dot)com>
To: Brice André <brice(at)famille-andre(dot)be>
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Optimize query for listing un-read messages
Date: 2014-05-04 16:53:57
Message-ID: OfficeNetEmail.b7.623504e52e18e017.145c825f77a@prod2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

På søndag 04. mai 2014 kl. 18:49:43, skrev Brice André <brice(at)famille-andre(dot)be
<mailto:brice(at)famille-andre(dot)be>>: Yes, I was a bit too fast. but replace it with
  WHERE NOT prop.is_read = TRUE
  and it should be OK.   No, that also will be treated as an INNER JOIN,
because it kills tuples where prop is null. I need entries where prop IS NULL
(hence the LEFT OUTER JOIN) because messages without an entry in
message_property must be treated as unread, the same as messages with an entry
in message_property where is_read=FALSE.   -- Andreas Jospeh Krogh CTO / Partner
- Visena AS Mobile: +47 909 56 963 andreas(at)visena(dot)com
<mailto:andreas(at)visena(dot)com> www.visena.com <https://www.visena.com>
<https://www.visena.com>  

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Brice André 2014-05-04 17:43:11 Re: Optimize query for listing un-read messages
Previous Message Brice André 2014-05-04 16:49:43 Re: Optimize query for listing un-read messages