summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-04-05 15:18:05 +0200
committerYorhel <git@yorhel.nl>2020-04-05 15:18:27 +0200
commit6d767e48b63c30fd572cff1fdf73bb2e60574848 (patch)
treeb330f7f37b42293fad2579fb7788e2be5ca7ecb6 /README.md
parenta53e57953a9f4a9912c70901b3841fd30a80bd1d (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 'README.md')
-rw-r--r--README.md13
1 files changed, 12 insertions, 1 deletions
diff --git a/README.md b/README.md
index 33be6269..18b1a948 100644
--- a/README.md
+++ b/README.md
@@ -45,7 +45,8 @@ can stop the container and run:
Global requirements:
- Linux, or an OS that resembles Linux. Chances are VNDB won't run on Windows.
-- PostgreSQL 10 (older versions may work)
+- A standard C build system (make/gcc/etc)
+- PostgreSQL 10+ (including development files)
- Perl 5.26+
- Elm 0.19.1
@@ -88,11 +89,21 @@ util/multi.pl (application server, optional):
```
- Setup a PostgreSQL server and make sure you can login with some admin user
+- Build the *vndbfuncs* PostgreSQL library:
+
+```
+ make -C sql/c
+```
+
+- Copy `sql/c/vndbfuncs.so` to the appropriate directory (either run
+ `sudo make -C sql/c install` or see `pg_config --pkglibdir` or
+ `SHOW dynamic_library_path`)
- Initialize the VNDB database (assuming 'postgres' is a superuser):
```
# Create the database & roles
psql -U postgres -f sql/superuser_init.sql
+ psql -U postgres vndb -f sql/vndbid.sql
# Set a password for each database role:
echo "ALTER ROLE vndb LOGIN PASSWORD 'pwd1'" | psql -U postgres