i o efficient similarity join
play

I/O-EFFICIENT SIMILARITY JOIN R. Pagh, N. Pham, F. Silvestri, M. - PowerPoint PPT Presentation

I/O-EFFICIENT SIMILARITY JOIN R. Pagh, N. Pham, F. Silvestri, M. Stckel Similarity Join R = Q . / r S = { ( q, x ) Q S | d ( q, x ) r } Similarity join example 1 (Record linkage) Country Name Token ID USA IBM Mircosoft 1 USA


  1. I/O-EFFICIENT SIMILARITY JOIN R. Pagh, N. Pham, F. Silvestri, M. Stöckel

  2. Similarity Join R = Q . / r S = { ( q, x ) ∈ Q × S | d ( q, x ) ≤ r }

  3. Similarity join example 1 (Record linkage) Country Name Token ID USA IBM Mircosoft 1 USA Microsoft SAP SE 2 Germany SAP I.B.M. 3 China Baidu baidu.com 4

  4. Similarity join example 2 (Classification) Class Name Features Features Image ID Mammalia Cat 1100101 0101101 1 Mammalia Dog 1101101 1001000 2 Reptilia Snake 1011000 1101101 3 Aves Parrot 1010111 1101110 4

  5. Memory hierarchy • Input sets do not fit in memory • Use external memory model [Vitter 2008] • I/O complexity of an algorithm: number of I/Os Block transfer Memory M size B CPU • Cache-aware algorithm : algorithm that knows M, B • Cache-oblivious algorithm : algorithm that doesn’t know M, B

  6. The N 2 barrier • Let N = | Q | = | S | • We cannot avoid N 2 /( BM) I/Os in the worst case • Consider N points into a ball of radius r/2: N 2 near pairs • No more than M 2 pairs can be created with M/B I/Os • Naïve approach is worst-case optimal! • Split Q, S into chunks of size M • Load in memory each combination of chunks from Q and S • Check all pair in memory • Cache-oblivious version by [He and Luo, 2006] • We are interested in output-sensitive algorithms

  7. Locality Sensitive Hashing sensitive family H of functions ( r, cr, p 1 , p 2 ) − if d ( x, y ) ≤ r then Pr h ∈ H [ h ( x ) = h ( y )] ≥ p 1 if d ( x, y ) > cr then Pr h ∈ H [ h ( x ) = h ( y )] ≤ p 2 Quality of an LSH is given by ρ = log p 1 log p 2 (the smaller, the better)

  8. Similarity join with LSH False positives pairs | R >r, ≤ cr S | . / Filtered away in time

  9. Similarity join with LSH + I/O model • Simple implementation • Construct a data structure for c-approximate r -near neighbor using set Q ◆ ρ ◆ ✓✓ N ˜ • Query I/O O B • Space � N 1+ ρ � O • For each point in R search the r -near neighbor in the above data structure ✓ N ◆ 1+ ρ ! ˜ • Total I/O (with batched search) O B

  10. Our results • Cache-aware and cache-oblivious algorithms for similarity join that find all near pairs w.h.p., use linear space and require Cost of generating output Overhead ✓ N 0 0 | R . ≤ r S | 1 | R . ≤ cr S | 1 / / ◆ ρ @ N ˜ A + A I/O B + O @ Probability of M MB MB collision decreases with distance Cost of reading input Nasty term • Algorithms work for any distance measure with a monotonic LSH

  11. Is so bad? | R >r, ≤ cr S | . /

  12. Cache-aware LSH • Suppose we have this LSH ◆ ρ ✓ M collisions with near points ( ≤ r) p 1 ∼ N p 2 ∼ M collisions with far points (> cr) N • At most M far points collide with a given point (in expectation)

  13. Cache-aware algorithm Repeat 1/p 1 times Choose h in H uniformly at random 1. Partition Q and S into buckets with h 2. For each value v where Q v and S v are not empty 3. Split Q v and S v into chunks of size M/2 a. Load Q v,i and R v,i for every i,j and emit all near pairs in Q v,i x R v,i b.

  14. Example S ¡ 0 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ S ¡ 0 ¡ 0 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 0 ¡ S ¡ 0 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ 0 ¡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¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 0 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ S ¡ 0 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ Q ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 0 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 0 ¡ 1 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 0 ¡ 0 ¡ 0 ¡ Q ¡ 0 ¡ 0 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 0 ¡ 0 ¡ 0 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 0 ¡ Q ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ Q ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ 0 ¡ 1 ¡ 0 ¡ 1 ¡ 0 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ Q ¡ 0 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ Q ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ Q ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ Q ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ Q ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ Q ¡ 0 ¡ 1 ¡ 0 ¡ 1 ¡ 0 ¡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