Re-work the gen_time_listings query WHERE clause.

This commit is contained in:
Jason Harvey
2012-11-04 07:06:09 -07:00
parent 856a67e845
commit d476208e38

View File

@@ -69,7 +69,12 @@ psql -F"\t" -A -t -d newreddit -U $USER -h $LINKDBHOST -p $DB_PORT \
where t.thing_id = d.thing_id
and not t.spam and not t.deleted
and d.key in ('url', 'sr_id')
and t.date > now() - interval '1 $INTERVAL'
and t.thing_id > (
select thing_id from reddit_thing_link t WHERE t.date > now ( ) - interval '1 $INTERVAL' LIMIT 1
)
and d.thing_id > (
select thing_id from reddit_thing_link t WHERE t.date > now ( ) - interval '1 $INTERVAL' LIMIT 1
)
) to '$DNAME'"
function mrsort {