2014-05-01 21:39 GMT+02:00 Andreas Joseph Krogh <andreas@xxxxxxxxxx>:
På torsdag 01. mai 2014 kl. 21:30:39, skrev Pavel Stehule <pavel.stehule@xxxxxxxxx>:Hello[snip]I had a perfect success on similar use case with descent ordered partial index
http://www.postgresql.org/docs/9.3/interactive/sql-createindex.htmlI'm not getting good performance. Are you able to craft an example using my schema and partial index?
maybe some like
CREATE INDEX ON message_property (person_id, message_id) WHERE pr.is_read
When I am thinking about your schema, it is designed well, but it is not index friendly, so for some fast access you should to hold a cache (table) of unread messages.
Regards
Pavel
Thanks.