indexer: Don't overwrite man page contents when hash already exist
Performance improvement. The ON CONFLICT DO UPDATE was primarily to make sure that old man pages would get fixed when the indexer did a better job at detecting the encoding, but there haven't been any relevant fixes to the indexer lately so this forced-update won't do much now.
This commit is contained in:
parent
2974ee929e
commit
ce38ff885f
1 changed files with 1 additions and 5 deletions
|
|
@ -119,12 +119,8 @@ fn insert_man(tr: &postgres::GenericConnection, verid: i32, paths: &[&str], ent:
|
||||||
cont = cont.replace(0 as char, "");
|
cont = cont.replace(0 as char, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Overwrite entry if the contents are different. It's possible that earlier decoding
|
|
||||||
// implementations didn't properly detect the encoding. (On the other hand, due to differences
|
|
||||||
// in filenames it's also possible that THIS decoding step went wrong, but that's slightly less
|
|
||||||
// likely)
|
|
||||||
tr.execute(
|
tr.execute(
|
||||||
"INSERT INTO contents (hash, content) VALUES($1, $2) ON CONFLICT (hash) DO UPDATE SET content = $2",
|
"INSERT INTO contents (hash, content) VALUES($1, $2) ON CONFLICT (hash) DO NOTHING",
|
||||||
&[&dig.as_ref(), &cont]
|
&[&dig.as_ref(), &cont]
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue