to sample, R will contain the result, K number of items to select 4ReservoirSample(S[1..n]= S[i] 9 // replace elements with gradually decreasing probability
10 for i = k+1 to n
: `tag` varchar, `weight` float,我想创建一个新表,其中包含每个标签的前N目前我这样做:select distinct tag select * limit N insertinto the new table
这需要执行查询以获得不同的tag,然后为该标记选择顶级N项并插入它