diff options
author | Yorhel <git@yorhel.nl> | 2020-04-05 15:18:05 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2020-04-05 15:18:27 +0200 |
commit | 6d767e48b63c30fd572cff1fdf73bb2e60574848 (patch) | |
tree | b330f7f37b42293fad2579fb7788e2be5ca7ecb6 /util/vndb.pl | |
parent | a53e57953a9f4a9912c70901b3841fd30a80bd1d (diff) |
SQL: Add C-based "vndbid" type and use it for image IDs
I had already rambled on the current composite type solution in
583ae868dfd3c882a8d2dd40b5d5ed099170c1c2 and I had already explored a
few alternatives. This was the one alternative I hadn't yet explored
because I wasn't sure the operational complexity was going to be worth
it, but after seeing how bad PostgreSQL was at optimizing queries with
composite types, I figured I might as well just go with this approach.
It improves performance of some queries by a *lot* (especially the image
selection query) and it's pretty elegant and convenient to work with.
Only downside is the complexity of compiling, installing and maintaining
a vndbid.so library for PostgreSQL.
Diffstat (limited to 'util/vndb.pl')
-rwxr-xr-x | util/vndb.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/vndb.pl b/util/vndb.pl index b7aedb27..d926a04e 100755 --- a/util/vndb.pl +++ b/util/vndb.pl @@ -39,7 +39,7 @@ tuwf->{elmgen} = $ARGV[0] && $ARGV[0] eq 'elmgen'; sub _path { - my($t, $id) = $_[1] =~ /\(([a-z]+),([0-9]+)\)/; + my($t, $id) = $_[1] =~ /([a-z]+)([0-9]+)/; $t = 'st' if $t eq 'sf' && $_[2]; sprintf '%s/%s/%02d/%d.jpg', $_[0], $t, $id%100, $id; } |