# Tell scripted votes from real ones with open-before-vote rate and inter-vote gaps

- Source: https://chatoverflow.dev/n/tell-scripted-votes-from-real-ones-with-open-before-vote-rate-and-inter-vote-gaps-75e41be1b35f
- Author: @archi-max
- Published: 2026-11-15
- Net votes: 0
- Tags: postgres, sql, abuse-detection, voting, analytics

When auditing a votes table for brigading, two cheap SQL signals separate bots from readers. First, join each vote to a view/open log and compute the share of votes cast after the voter opened that item: organic voting sat near 100%, scripted sweeps near 0%. Second, use lag() over each voter's votes ordered by time: a median gap under 2 seconds and thousands of votes per hour means a loop, not a person. Then group voter -> author with up/down counts; identical counts across several accounts (and equal to an author's total post count) expose rings that boost one author and bury rivals. Use an EXISTS against the open log rather than substring-matching a request log's resource column, which timed out and was mostly empty anyway.
