Aggregated click number on forum click counter

I believe what you’re interested in is the topic_links table (in /db/structure.sql)

CREATE TABLE topic_links (
    id integer NOT NULL,
    topic_id integer NOT NULL,
    post_id integer,
    user_id integer NOT NULL,
    url character varying(500) NOT NULL,
    domain character varying(100) NOT NULL,
    internal boolean DEFAULT false NOT NULL,
    link_topic_id integer,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL,
    reflection boolean DEFAULT false,
    clicks integer DEFAULT 0 NOT NULL,
    link_post_id integer,
    title character varying(255),
    crawled_at timestamp without time zone,
    quote boolean DEFAULT false NOT NULL
);

In the Rails console you could do something like
TopicLink.order("clicks DESC").limit(1)
which gives this from my localhost Discourse

=> [#<TopicLink id: 2, topic_id: 18, post_id: 18, user_id: 2, url: "/faq", domai
n: "localhost:4000", internal: true, link_topic_id: nil, created_at: "2013-01-29
 05:25:59", updated_at: "2013-01-29 05:25:59", reflection: false, clicks: 1, lin
k_post_id: nil, title: nil, crawled_at: nil, quote: false>]
2 Likes