mirror of
https://github.com/Syfaro/fuzzysearch.git
synced 2024-11-23 15:22:31 +00:00
Revert using UNION instead of UNION ALL.
This commit is contained in:
parent
96bc22c65b
commit
f040cf3dde
@ -173,8 +173,8 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"7953d382d35d07effb803c1b80c6efba81e3db90d0abfe3a40cd66b9106ce44d": {
|
"d6a5ed9266d7cf6f08df5e0160c59843a15ef5ef3ccac2e5ccfe2251a50bd0dc": {
|
||||||
"query": "SELECT hash_int hash FROM submission WHERE hash_int IS NOT NULL\n UNION\n SELECT hash FROM e621 WHERE hash IS NOT NULL\n UNION\n SELECT hash FROM tweet_media WHERE hash IS NOT NULL\n UNION\n SELECT hash FROM weasyl WHERE hash IS NOT NULL",
|
"query": "SELECT hash_int hash FROM submission WHERE hash_int IS NOT NULL\n UNION ALL\n SELECT hash FROM e621 WHERE hash IS NOT NULL\n UNION ALL\n SELECT hash FROM tweet_media WHERE hash IS NOT NULL\n UNION ALL\n SELECT hash FROM weasyl WHERE hash IS NOT NULL",
|
||||||
"describe": {
|
"describe": {
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
|
@ -172,11 +172,11 @@ async fn create_tree(conn: &Pool) -> bk_tree::BKTree<Node, Hamming> {
|
|||||||
|
|
||||||
let mut rows = sqlx::query!(
|
let mut rows = sqlx::query!(
|
||||||
"SELECT hash_int hash FROM submission WHERE hash_int IS NOT NULL
|
"SELECT hash_int hash FROM submission WHERE hash_int IS NOT NULL
|
||||||
UNION
|
UNION ALL
|
||||||
SELECT hash FROM e621 WHERE hash IS NOT NULL
|
SELECT hash FROM e621 WHERE hash IS NOT NULL
|
||||||
UNION
|
UNION ALL
|
||||||
SELECT hash FROM tweet_media WHERE hash IS NOT NULL
|
SELECT hash FROM tweet_media WHERE hash IS NOT NULL
|
||||||
UNION
|
UNION ALL
|
||||||
SELECT hash FROM weasyl WHERE hash IS NOT NULL"
|
SELECT hash FROM weasyl WHERE hash IS NOT NULL"
|
||||||
)
|
)
|
||||||
.fetch(conn);
|
.fetch(conn);
|
||||||
@ -185,9 +185,12 @@ async fn create_tree(conn: &Pool) -> bk_tree::BKTree<Node, Hamming> {
|
|||||||
|
|
||||||
while let Some(row) = rows.try_next().await.expect("Unable to get row") {
|
while let Some(row) = rows.try_next().await.expect("Unable to get row") {
|
||||||
if let Some(hash) = row.hash {
|
if let Some(hash) = row.hash {
|
||||||
tree.add(Node::new(hash));
|
let node = Node::new(hash);
|
||||||
count += 1;
|
if tree.find_exact(&node).is_none() {
|
||||||
|
tree.add(node);
|
||||||
|
}
|
||||||
|
|
||||||
|
count += 1;
|
||||||
if count % 250_000 == 0 {
|
if count % 250_000 == 0 {
|
||||||
tracing::debug!(count, "Made progress in loading tree rows");
|
tracing::debug!(count, "Made progress in loading tree rows");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user