+ * WARNING: If $filter_tag contains more than one tag, this function will add DISTINCT,
+ * which may cause performance problems for your query unless you put the ID field of your
+ * table at the end of the ORDER BY, and set a GROUP BY equal to the ORDER BY. For example,
+ * if you had ORDER BY foo_timestamp DESC, you will now need GROUP BY foo_timestamp, foo_id
+ * ORDER BY foo_timestamp DESC, foo_id DESC.
+ *