https://github.com/ekzhu/go-sql-lsh
Locality Sensitive Hashing using Golang and SQL database
https://github.com/ekzhu/go-sql-lsh
Last synced: 6 months ago
JSON representation
Locality Sensitive Hashing using Golang and SQL database
- Host: GitHub
- URL: https://github.com/ekzhu/go-sql-lsh
- Owner: ekzhu
- License: mit
- Created: 2016-03-22T22:17:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-06-23T06:56:15.000Z (over 9 years ago)
- Last Synced: 2025-04-10T21:15:08.727Z (6 months ago)
- Language: Go
- Size: 12.7 KB
- Stars: 28
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-sql-lsh
[](https://travis-ci.org/ekzhu/go-sql-lsh)
This is an experimental implementation of Locality Sensitive Hashing (LSH)
index using relational databases.
This library does not implement any specific locality-sensitive hash function
family,
but provides a generic storage backend for the hash values.
See [Documentation](https://godoc.org/github.com/ekzhu/go-sql-lsh)
for details.Currently only Sqlite and PostgreSQL are supported.
To install:
```
go get github.com/ekzhu/go-sql-lsh
```To run the tests and benchmarks, you need to install the Go
libraries for PostgreSQL and Sqlite3:```
go get github.com/lib/pq
go get github.com/mattn/go-sqlite3
```A performance comparison is shown in the table below.
Numbers are average query times, in millisecond.
There are 10,000 signatures in the index for all runs.| Signature Size | Sqlite | PostgreSQL |
|-----------------|---------|-------------|
| 128 (k=2, l=64) | 60.59 | 35.34 |
| 256 (k=4, l=64) | 76.92 | 36.09 |
| 512 (k=8, l=64) | 95.07 | 47.46 |