PerlThomas Klausnerhttp://domm.plix.at/perl.xml2023-08-19T10:00:00+00:00XML::Atom::SimpleFeedThings I learned at PerlKohaCon 2023http://domm.plix.at/perl/2023_08_things_i_learned_at_perlkohacon.html2023-08-19T10:00:00+00:00I've spend the last week in Helsinki, Finland, attending PerlKohaCon 2023, hosted by the National Library of Finland and organized by Andreii aka nugged and his team.
This was the first time we had ...<p>I've spend the last week in Helsinki, Finland, attending <a href="https://perlkohacon.fi/">PerlKohaCon 2023</a>, hosted by the <a href="https://www.kansalliskirjasto.fi/en">National Library of Finland</a> and organized by Andreii aka <a href="https://t.me/nugged">nugged</a> and his team.</p>
<p>This was the first time we had a combined European Perl Conference and KohaCon. For those that don't know <a href="https://koha-community.org/">Koha</a> (which is unfortunately true for a lot of Perl devs), it's a fully featured, scalable & open source library management system written in Perl.</p>
<p>Some aspects of KohaCon where "ported" to the Perl Conference part (e.g. free attendance as compared the usual fee of €100+ for PerlCon), while we introduced the Koha crowd to features like Lighting Talks. Generally it took some time (and two social events followed by more hanging-out-in-bars) for the two groups to mingle, but at the end of the event I had the feeling that the mixing / unification of the two communities started to happen.</p>
<p>For me (professionally) this event was perfect, as <a href="https://koha-support.eu">we</a> started to work with Koha a few years ago, and meeting the core devs and other community members makes working with (and on!) Koha much easier.</p>
<p>The only downside was the rather small number of attendees, at least from the Perl contingent (I never attended a KohaCon before, so I don't know how many people usually attend those). I guess the low number was caused by factors like the slightly remote location of Helsinki and the rather late announcement of the conference and the schedule. Maybe the fact that this event was a joint Perl-and-Koha-event also scared some people off?</p>
<h3>Things I learned (and other notes)</h3>
<ul>
<li>According to Kelly and Jessie people actually prefer video content over written one. (I don't, which probably explains all the white hair in my beard (or the other way around?))</li>
<li>Providing "Attractive Code Hunks" increases the chance of your patches to be merged</li>
<li>There is an effort to rebuild Ukrainian libraries and help them to use Koha: <a href="https://perlkohacon.fi/ULRI.html"><span class="caps">ULRI </span>- Ukrainian Libraries Restoration Initiative</a></li>
<li>This was the first PerlCon where an actual ambassador gave a speech: Olga Dibrova, Ambassador Extraordinary and Plenipotentiary of Ukraine in the Republic of Finland (what a title)</li>
<li>Don't submit three talks and assume not all will be picked</li>
<li>German and Maori seem to use similar pronounciations, which makes it easy for me to correctly say "Koha"</li>
<li>Drinks are expensive in Helsinki (~€9)</li>
<li>Even all all-vegan buffet will be cleaned by a crowd of Perl (and Koha) devs.</li>
<li>The Finns seem to suffer from a Category Mismatch regarding "Longdrink". In Finland, <a href="https://www.originallongdrink.com/">Longdrink</a> references a specific drink instead of the whole category of long-drinks. (As if there was one brand of beer called "Beer"). I had a few of them, anyway :-)</li>
<li>Live Demos and restrictive <span class="caps">WLAN</span>s don't mix well</li>
<li>But other Live Demos work all to well (and might rickroll you..)</li>
<li>Doing a talk on Ansible <strong><span class="caps">AND</span></strong> attending one help to finally understand how it all works.</li>
<li>But <a href="https://metacpan.org/pod/Rex">Rex</a> still seems like the solution that better matches by brain. And you don't have to "program in <span class="caps">YAML</span>"!</li>
<li>Nobody knows what <a href="https://perlkohacon.fi/Schedule.html#?talk_id=39">Life</a> actually is, but we're still looking for it everywhere.</li>
<li>Sea cruises are a lot of fun, especially when accompanied by Perl and Koha friends and some Original Longdrinks</li>
<li>It took me some time (and asking a native speaker) to figure out that <strong>all</strong> the milk options where lactose free (but just different kinds of milk)</li>
<li>There's a mastodon <a href="https://gitlab.com/eythian/exhibit-explorer">bot</a> that posts items from various museums catalogues called <a href="https://botsin.space/@ExhibitExplorer">ExhibitExplorer</a> - very nice idea, let's see if I can find some <span class="caps">API</span>s of Viennese museums</li>
<li>Taking notes during talks helps writing up the "Things I learned" section, and slacking on taking notes results in a rather short list (see: this post..)</li>
<li>I learned how to sign off Koha patches and improved my skill at submitting patches - all hail Katrin Fischer and her infinite patience!</li>
<li>I got to show off my mediocre vim & bash skills</li>
<li><a href="https://oodihelsinki.fi/en/">Oodi</a> is an amazing library / community centre, which employs robots to transport boxes of books around</li>
<li>I learned the Finnish way to prepare ketchup at Hesburger (involving lots of very small packets of salt, pepper and some chili mix)</li>
<li>When showing <a href="https://helsinkifestival.fi/taiteidenyo/en/event/final-scenes-of-disaster-movies/">Final Scenes of Disaster Movies</a> in Finnish, it would be better to provide surtitles instead of subtitles (so add them to the top of the screen where people from the back can read them)</li>
<li>New (first) favorite Finnish band: <a href="http://cleaningwomen.com/">The Cleaning Women</a> - great outfits, cool instruments and quite a show!</li>
<li>My vinyl-hunting-skill are still up-to-date, as I managed to procure their latest vinyl on Friday.</li>
</ul>
<h3>My talks</h3>
<p>I did three talks:</p>
<ul>
<li><a href="https://domm.plix.at/talks/deploy_podman_ansible.html">Deploying apps using Podman and Ansible</a></li>
<li><a href="https://domm.plix.at/talks/openapi.html">OpenAPI, Perl & Koha</a></li>
<li><a href="https://domm.plix.at/talks/koha_geosearch.html">Koha Geosearch</a></li>
</ul>
<p>There are video recordings available, but you have to find them in the full day recordings; the organizers will provide stand alone videos later)</p>
<h3>Thanks</h3>
<p>As always: A big Thank-you to the orgas, speakers, sponsors and attendees!</p>Perl Skewerhttp://domm.plix.at/perl/2023_07_skewer.html2023-07-02T21:51:11+00:00Today a colleague posted the following "confession":
I prepare vegetable skewers by starting with a mushroom head and a slice of bell pepper as open parenthesis, and than make sure that they match ...<p>Today a <a href="https://farhad.shahbazi.at/">colleague</a> posted the following "confession":</p>
<pre><code>I prepare vegetable skewers by starting with a mushroom head and a slice of bell pepper as open parenthesis, and than make sure that they match up at the other end.</code></pre>
<p>Turns out you can do that in Perl, too:</p>
<pre><code>$~ perl -Mutf8 -E 'my @skewer = qw 🍄 some delicious vegs 🍄; say $skewer[1]'
delicious</code></pre>
<p>Yay!</p>
<p>This uses the <code>qw</code> operator (short for "quote words") to build a list of words. Usually you would use <code>qw</code> like this:</p>
<pre><code>my @skewer = qw(some delicious vegs);</code></pre>
<p>Or use some other parenthesises:</p>
<pre><code>my @skewer = qw[some delicious vegs];
my @skewer = qw{some delicious vegs};</code></pre>
<p>But if you add a space after <code>qw</code> you can use <b>any</b> character instead of parenthesis-y ones:</p>
<pre><code>my @skewer = qw ;some delicious vegs;;</code></pre>
<p>This sometimes makes sense when whatever content your quoting contains parenthesis.</p>
<p>And it allows for fun mushroom skewers!</p>
<h4>Edits:</h4>
<p>Fixed translation error (paprika vs bell pepper) reported by <a href="https://www.reddit.com/r/perl/comments/14oxwnb/comment/jqfadh1/">tyrminal</a></p>New release of Plack::App::ServiceStatushttp://domm.plix.at/perl/2023_02_plack_app_servicestatus.html2023-02-14T19:31:17+00:00A few days ago I released version 0.910 of Plack::App::ServiceStatus, a small Plack app that can be used for health checks and general info about your app and its dependencies. Generate ...<p>A few days ago I released <a href="https://metacpan.org/pod/Plack::App::ServiceStatus">version 0.910 of Plack::App::ServiceStatus</a>, a small <a href="https://metacpan.org/pod/Plack">Plack</a> app that can be used for health checks and general info about your app and its dependencies.</p>
<h3>Generate buildinfo.json</h3>
<p>The new version comes with a small script that you can use to gather some info during the build / deployment of your app, which is stored into a file (<code>buildinfo.json</code>), which than can be displayed by Plack::App::ServiceStatus:</p>
<pre><code> ~/$ plack_app_service_status_generate_buildinfo.pl --project path/to/repo --output path/to/deployment/buildinfo.json</code></pre>
<p>I like to add this line to my build pipelines and/or Makefile.</p>
<h3>Using Plack::App::ServiceStatus</h3>
<p>You only need to define the Plack app, passing some static info like <code>app name</code> and <code>version</code>, the new <code>buildinfo</code> file, and define any checks you want to include:</p>
<pre><code> my $status = Plack::App::ServiceStatus->new(
app => 'your app',
version => Your::App->VERSION,
buildinfo => 'path/to/buildinfo.json'
DBIC => [ $schema, 'select 1' ],
Elasticsearch => $es, # instance of Search::Elasticsearch,
);</code></pre>
<p>Then mount ServiceStatus at some convenient route, eg <code>/_status</code>:</p>
<pre><code> builder {
mount "/_status" => $status->to_app;
mount "/" => $your_app;
};</code></pre>
<p>And when you call <code>/_status</code> you'll get some information about your service (uptime etc), it's dependencies (eg if we can ping the database) and <strong>all new</strong> the buildinfo:</p>
<pre><code> {
"app" : "Your::App",
"buildinfo" : {
"date" : "2023-02-14T17:02:08Z",
"git-branch" : "main",
"git-commit" : "e8d434ab8e6ad8e93945d704ba115da149525d01"
},
"checks" : [
{
"name" : "Your::APP",
"status" : "ok"
},
{
"name" : "DBIxConnector",
"status" : "ok"
}
],
"hostname" : "39132fc9cd48",
"started_at" : 1676394140,
"started_at_iso8601" : "2023-02-14T17:02:20Z",
"uptime" : 4714,
"version" : 0.913
}</code></pre>
<p>You can also use this endpoint for health checks, general monitoring, showing debug info in a frontend / mobile app, etc. Or just watch it and be happy that everything works!</p>Things I learned at PGConf.EU 2022http://domm.plix.at/perl/2022_10_things_i_learned_at_pgconfeu.html2022-10-28T10:35:16+00:00The biggest yearly European Postgres, PGConf.EU took place from 26th to 28th October in Berlin. As I have a bunch of friends in Berlin and like Postgres, I decided to attend. I also submitted a talk ...<p>The biggest yearly European <a href="https://www.postgresql.org/">Postgres</a>, <a href="https://2022.pgconf.eu/">PGConf.EU</a> took place from 26th to 28th October in Berlin. As I have a bunch of friends in Berlin and like Postgres, I decided to attend. I also submitted a talk but wasn't accepted (which in the end did not surprise me, as they got more than 260 submissions and could only accept ~80). So after a nice and productive 8h train ride from Vienna to Berlin, I spend three very informative days at the conference, met up with my <a href="https://berlin.pm.org/">Perl friends</a> in a nice beer garden with a gigantic chestnut tree, and also spend a few nice evenings / breakfasts with various old friends who moved to Berlin ages ago. I got to cycle around quite a lot (very nice), but missed the Critical Mass on Friday (hanging around with friends was nicer...)</p>
<p>Here are my slightly edited notes about what I learned (or at least try to remember) and/or found funny, directly from the train ride back to Vienna. The notes might contain errors and misunderstandings, so please do check out the slides of the talks, which are hopefully linked from the respective talk pages.</p>
<h3>Day1</h3>
<ul>
<li><p><a href="https://www.postgresql.eu/events/pgconfeu2022/schedule/session/4072-efficient-graph-analysis-with-sqlpgq/">Efficient Graph Analysis with SQL/PGQ</a> - Peter Boncz</p>
<ul>
<li>Happy that I don't have enough data to worry about CPU cache hits</li>
<li>Cypher (graph query language) looks .. complex</li>
<li>"ASCII Art graph syntax" : <code>MATCH (x:Account)−[:isLocatedIn]−>(g:City)<−[:isLocatedIn]−(y:Account)</code></li>
<li>SQL/PGQ is a new standard based on Cypher and similar prior art</li>
<li>could be done with <code>with recursive</code> but comparable recursive queries are much more complex</li>
<li>But it would be nice to have it in Postgres (and I think it's planned?)</li>
</ul></li>
<li><p><a href="https://www.postgresql.eu/events/pgconfeu2022/schedule/session/3831-changelog-vs-two-dimensional-time-what-works-better/">Changelog vs Two-dimensional time - what works better?</a> - Henrietta Dombrovskaya</p>
<ul>
<li>Similar to "Temporal Tables" (which is an SQL standard to limit the validity of data to a given time range), but with one more dimension (hence "bi-temporal")</li>
<li>https://github.com/hettie-d/pg_bitemporal</li>
<li>Can be done in Postgres thanks to support for range types, infinity and GIST index</li>
<li>"You can do that easily in one gigantic CTE"</li>
<li><code>SELECT * FROM bitemp WHERE now()<@asserted and now()<@effective</code></li>
</ul></li>
<li><p><a href="https://www.postgresql.eu/events/pgconfeu2022/schedule/session/3864-brin-improvements-and-new-opclasses/">BRIN improvements and new opclasses</a> - Tomas Vondra</p>
<ul>
<li>BTREEs are nice and useful, but large (on disk)</li>
<li>BRIN only works (well) with proper data, eg append-only timestamps</li>
<li><code>minmax_multi</code> to work around outliers destorying index performance</li>
<li>bloom-filter, good for uuid (do we need that for access-by-uuid? - not for primary key, so still need to check)</li>
<li>"It's all about being smarter by not doing work that doesn't need to be done"</li>
</ul></li>
<li><p><a href="https://www.postgresql.eu/events/pgconfeu2022/schedule/session/3936-performance-tips-you-have-never-seen-before/">Performance tips you have never seen before</a> - Hans-Jürgen Schönig</p>
<ul>
<li>latency matters (connect via localhost vs socket)</li>
<li>column order matters for storage (first fixed size (int) due to "alignment", then relevant (esp for broad tables))</li>
<li>index: <code>hashtext(email)</code>, then <code>select ... where hashtext(email) = hashtext('serach@email') and email ='search@email'</code></li>
<li><code>pgstattuple</code></li>
<li>FDW fetch_size</li>
<li>Fulltext index needs vacuum regularly (because new entries will be put into a pending list, which has to be seqscanned after checking the index and is only merged during vacuum)</li>
</ul></li>
<li><p><a href="https://www.postgresql.eu/events/pgconfeu2022/schedule/session/3902-understanding-the-impact-of-materialized-ctes/">Understanding the impact of Materialized CTEs</a> - Divya Sharma</p>
<ul>
<li>CTE always materialized to temporary table (before 12), 12+ has conditional materialization</li>
<li>work_mem, enable_master</li>
<li>recursive (or multiple references), "with sideeffect", <code>MATERIALZE</code> => always materialize</li>
<li><code>generate_series</code> is not only used by consultants (as suggested by Hans-Jürgen Schönig earlier), but in ~50% of talks at pgconfeu :-)</li>
<li><code>NOT MATERIALIZED</code> -> inline even though planer would not inline, which can be faster depending on indexes and the CTE. "It depends"</li>
</ul></li>
<li><p><a href="https://www.postgresql.eu/events/pgconfeu2022/schedule/session/3985-no-array-of-sunshine-an-introduction-to-data-types-from-a-data-quality-perspective/">No Array of Sunshine: an Introduction to Data Types from a Data Quality Perspective</a> - Renee Phillips</p>
<ul>
<li>Goldilocks and the tree data types => other talk to check out?</li>
<li>Postgres is using 1-based array</li>
<li>Don't use "NULL" as your vanity license plate</li>
<li>True duplicates vs fake duplicates (eg times without timezone on timezone change)</li>
<li>"You solve one problem, you create at least one more"</li>
<li>Good talks, but a bit to basic for me</li>
</ul></li>
<li><p><a href="https://www.postgresql.eu/events/pgconfeu2022/schedule/session/3962-inside-the-machine-room-of-a-world-map-postgresql-and-openstreetmap/">Inside the machine room of a world map: PostgreSQL and OpenStreetMap</a> - Sarah Hoffmann</p>
<ul>
<li>OSM is not using PostGIS!!</li>
<li>it has three main data types: node, way, relation</li>
<li>OSM is "a experiment to get away with as little as possible to achieve world domination"</li>
<li>it is BIG!</li>
<li>World-Dump takes ~2 days, so they are generated from a restored backup</li>
<li>tileID bit-interleaved lat/lon</li>
<li>9.5, because of index in transaction-id (which is not allowed after 9.6)</li>
<li>osm2pgsql</li>
</ul></li>
</ul>
<h3>Day 2</h3>
<ul>
<li><p><a href="https://www.postgresql.eu/events/pgconfeu2022/schedule/session/4015-a-comparison-of-postgresql-backup-tools/">A comparison of PostgreSQL backup tools</a> - Matt Pearson</p>
<ul>
<li>Don't store backups on same partition as the data</li>
<li>pg_dump for migrations but not (good) backup, slow</li>
<li>pg_dumpall: all databases, includes roles</li>
<li>Barman</li>
<li>pgBackRest</li>
<li>Unfortunately there were a few easily avoidable speaker errors: very small font size on the flowchart, don't turn back on audience</li>
</ul></li>
<li><p><a href="https://www.postgresql.eu/events/pgconfeu2022/schedule/session/3811-how-to-handle-1000-application-users/">How to handle 1000 application users</a> - Laurenz Albe</p>
<ul>
<li>always nice to hear Austrian English accents</li>
<li>connection to DB is expensive, takes lot of server resources</li>
<li>lot of connections makes SQL statements more expensive (because each idle connection has to be checked</li>
<li>work_mem is per connections, so one cannot have high work_mem with lots of connection</li>
<li>pg_stats_activity wait_events is probably bad</li>
<li>no way to limit the number of active connections</li>
<li>=> connection pool</li>
<li>less active connection = less CPU task switching</li>
<li>prepared statements cannot be use with transactional pooling. Fix: put statement into PLSQL function</li>
<li>application server pooling possible (but probably not for plack when we fork lots of processes)</li>
<li>pgBouncer</li>
<li>no more active connections than CPU-Cores / parallel I/O requests</li>
<li>short queries; idle_in_transaction time should be short</li>
</ul></li>
<li><p>"How do you put an elephant in a container in 3 steps?"</p>
<ul>
<li>room full, so could not attend</li>
</ul></li>
<li><p><a href="https://www.postgresql.eu/events/pgconfeu2022/schedule/session/3934-neon-cloud-native-storage-backend-for-postgresql/">Neon, cloud-native storage backend for PostgreSQL</a> - Heikki Linnakangas</p>
<ul>
<li>"postgres without storage" / separate compute from storage</li>
<li>not in Postgres, needs patches and extension</li>
<li>very cool, but probably not something I'll use</li>
<li>"works very well on the powerpoint platform" :-)</li>
</ul></li>
<li><p><a href="https://www.postgresql.eu/events/pgconfeu2022/schedule/session/3789-mvcc-unmasked/">MVCC Unmasked</a> - Bruce Momjian</p>
<ul>
<li>Multi Version Concurrency Control</li>
<li>reader don't block writers, writers don't block readers</li>
<li>function vs procedure: all functions use same snapshot, procedures can "commit" snapshots</li>
<li>very nice snapshot rule / row visibility slide</li>
<li>transaction (ids) have an "aborted" flag, so the txnid still is in xmax, but ignored</li>
<li>another nice slide about page layout, item-pointer, data; dead items, index pointer</li>
<li>Very good talk explaining MVCC very well!</li>
</ul></li>
<li><p><a href="https://www.postgresql.eu/events/pgconfeu2022/schedule/session/3860-google-alloydb-vs-amazon-aurora-vs-azure-hyperscale-comparison-of-databases-build-for-clouds/">Google AlloyDB vs. Amazon Aurora vs. Azure Hyperscale: comparison of databases build for clouds</a> - Taras Kloba</p>
<ul>
<li>Nice summary slide at the start (with different types of cars)</li>
<li>Each provider seem to change quite a bit in Postgres, not sure I like that</li>
<li>Not too relevant for me, to cloudy</li>
<li>But I found a power outlet and migrated my mastodon account to (https://social.linux.pizza/@domm)[https://social.linux.pizza/@domm]</li>
</ul></li>
<li><p>Time-series, PostgreSQL, and You</p>
<ul>
<li>small room, lots of persons => this conf needs a better "query planner" :-)</li>
<li>again I could not attend</li>
</ul></li>
<li><p><a href="https://www.postgresql.eu/events/pgconfeu2022/schedule/session/4033-what-happens-when-stack-overflow-doesnt-have-an-answer-comparing-st_within-h3-for-spatial-queries/">What happens when stack overflow doesn’t have an answer? comparing ST_within & H3 for spatial queries</a> - Kshitij Purwar</p>
<ul>
<li>Power plant emission stats by analysing arial / satelite images and checking exhausts plumes, very smart!</li>
<li>Use H3 (by Uber) to improve performance of a spatial query</li>
<li>uses a hexagonal grid</li>
<li>H3 is hard to install</li>
<li>audience comment: alternatives could be st_simplified / st_subdivide</li>
</ul></li>
</ul>
<h3>Berlin.pm</h3>
<p>At the Berlin.pm meeting I had a nice few hours of chats, good food and drinks (well, Fassbrause), found a big fan of <a href="https://oe1.orf.at">oe1.orf.at</a> and a wrench to fix my bike and also learned about
* <a href="https://f4maps.com">F4Maps</a>
* The Critical Mass mobile app which allows you to share your current location and see the location of other riders in the area, so you can find where the CM is currently (nice if you missed the start or want to wait until they pass by your current location).</p>
<h3>Day 3</h3>
<ul>
<li><p><a href="https://www.postgresql.eu/events/pgconfeu2022/schedule/session/3950-full-page-writes-in-postgresql-critical-evil-or-both-why-you-should-care-and-how-to-optimize/">Full Page Writes in PostgreSQL - Critical, Evil or Both - Why you should care and how to optimize</a> - Grant McAlister</p>
<ul>
<li>If you turn off <code>full_pages_writes</code>, your database will be much faster. But you'll have data corruption :-)</li>
<li>I know nothing about WAL/pagewrites/checkpoints, ...</li>
<li>touching pages is bad, inserting/indexing uuids touches a lot of pages because they are random</li>
<li>nice slide on partitioning to reduce block size</li>
<li>I should read some intro docs...</li>
</ul></li>
<li><p><a href="https://www.postgresql.eu/events/pgconfeu2022/schedule/session/3999-practical-transactions-theory-for-postgresql-users/">Practical transactions theory for PostgreSQL users</a> - Ilya Kosmodemiansky</p>
<ul>
<li>ACID (ACI = memory, D = disk)</li>
<li>Phase Locking: slow, deadlock ("Reißverschlussverfahren")</li>
<li>Multi Version 2 Phase Locking = MVCC</li>
<li>hah, more page explanation: data in 8kb chunks</li>
<li>xmin/xmax again :-)</li>
<li>still hard to read xmax not as xmas</li>
<li>transaction handling happens in SharedMem, so Postgres processes one one machine can talk to each other fast</li>
<li>"An elephant never forgets"</li>
<li>Advisory locks for rare critical cases</li>
<li><code>select xmin from table</code> just works, I thought it needs some magic, but those fields are just invisible internal columns</li>
</ul></li>
<li><p><a href="https://www.postgresql.eu/events/pgconfeu2022/schedule/session/3999-practical-transactions-theory-for-postgresql-users/">Breaking the sound barrier - Applications at light speed</a> - Henrietta Dombrovskaya, Jan Karremans</p>
<ul>
<li>data -> program -> data (punchcards)</li>
<li>programs <-> data, needs DBMS (concurrency, security, ..)</li>
<li>DBMS = "specialised software designed to manage data in the most efficient way"</li>
<li>"Database agnostic Apps" are a hoax, no one switches databases (my comment: But there are database agnostic apps like CMS that target multiple DBMS)</li>
<li>3Ps: Performance, Performance, Performance</li>
<li>Devs: "Database is the source of all slowness"; DBAs: "Yes, if devs write stupid queries or let even stupider ORMs generate the stupidest SQL" (my words)</li>
<li>Relational DB and OO App hate each other = object relation impedance mismatch</li>
<li>Business Logic split into "Application business logic" (in the app) and "Data business logic" (in the DBMS)</li>
<li><a href="https://github.com/hettie-d/NORM">NORM - No ORM</a></li>
<li>App <=> Transfer Model (JSON) <=> DB</li>
<li>Generate DB functions from JSON Schema</li>
<li>Audience Comment: Devs don't think with the relation model, Maybe relational DBMS are the problem?</li>
</ul></li>
<li><p>Lunch break</p>
<ul>
<li>What are the odds of two people meeting at 600 person conference that not only know about <a href="https://www.loc.gov/marc/bibliographic/bd034.html">MARC21 034$s + $t</a>, but have recently submitted <a href="https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31652">some</a> <a href="https://github.com/postgis/postgis/pull/659">patches</a> regarding this field?</li>
<li>Whatever the odds, it did happen :-)</li>
</ul></li>
<li><p><a href="https://www.postgresql.eu/events/pgconfeu2022/schedule/session/4034-table-partitioning-transparent-but-no-magic/">Table Partitioning - Transparent but No Magic</a> - Boriss Mejias</p>
<ul>
<li>The first known partitioning implementation was Moses receiving the 10 commandments on two stone tablets</li>
<li><code>timestamp(0)</code> - no milliseconds, not needed for a lot of things, smaller tables, better</li>
<li>Very nice use of a game controller to illustrate that an index does not fix into RAM</li>
<li><code>[di, dj[</code> - inclusive range vs exclusive range</li>
<li>partitions are transparent, so <code>select count(*)</code> has to go through all partitioned tables</li>
<li>dynamic pruning: <code>select where date > now() - 1 month</code> will pick Oct and Sept</li>
<li>partition key does not need to be in where clause, could be in order_by</li>
<li>might plan all the partition, but does not execute all of them ("only clean up kitchen")</li>
<li>getting the query right is fundamental, CTEs help, but actual values seem to have to be used via subselect instead of join</li>
<li>partition large table when the have a logical partition key; need to use that key!!</li>
<li>partition by hash (eg hashed user id, modulo(n))</li>
</ul></li>
<li><p><a href="https://www.postgresql.eu/events/pgconfeu2022/schedule/session/3819-the-curious-case-of-the-point-of-sales-and-why-we-still-need-pglogical/">The curious case of the point of sales, and why we still need pglogical</a> - Jaime Casanova</p>
<ul>
<li>replication data to a lot of POS over bad network</li>
<li><code>pglogical.forward_origins</code> as a very weird data structure (empty array, or empty array with exactly one value <code>all</code>)</li>
<li>if <code>central</code> is not enough, add another <code>central2</code></li>
</ul></li>
<li><p>Lightning Talks</p>
<ul>
<li>"oh du lieber execute, alles ist hin"</li>
<li>faceting, roaring bitmaps => pgfaceting</li>
<li>There are Postgres shibboleth in hiring (just like in PERL^wperl^wPerl)</li>
<li>pg_crash - if your database is too reliable: "crash as a service"</li>
<li><code>insert .. on conflict</code> does nothing, whereas <code>insert</code> with error generates dead tuples (which is bad for page writes etc)</li>
<li>postgres.conf settings should be adapted for modern hard drives (because defaults target the lowest common denominator)</li>
<li>random_page_cost (1 or 1.1) >= seq_page_count</li>
<li>max_wal_size should be bigger than 1G ? but my DB is only 10GB?</li>
<li>autovacuum_vacuum_cost_delay 2ms</li>
</ul></li>
</ul>
<h3>General notes</h3>
<ul>
<li>Scheduling is hard
<ul>
<li>There weren't a lot of beginner talks (but I guess the conference is not targeted at beginners..)</li>
<li>Some talks referenced each other, but where in the "wrong order", i.e. a very detailed talk before a more general introduction.</li>
</ul></li>
<li>I need to talk with the orgas if we (Perl) can use their conference software for our events</li>
<li>Some stats from the closing speech:
<ul>
<li>600 attendees, 599 showed up (I just wonder if these where the same 599 people...)</li>
<li>150 speakers / 260 talks submitted</li>
</ul></li>
<li>My new varifocal glasses (yes, I'm that old) don't work well with the setup in the smaller rooms (flat floor and low hanging monitors) because I have to tilt my head to see above the heads in front of me, which results in me viewing through the "near" zone of the multifocals, which makes the slides (which are not near..) hard to read.</li>
<li>Is it now considered polite to thank speakers for their talk when asking a question, or is this a Postgresconf thing?</li>
<li>Lot of DBAs, few devs, and they (DBAs) don't like us (Devs) very much :-)</li>
<li>I used to mostly attend Perl conferences, where I'm quite well known and know a lot of people (inside jokes), and spend less time in talks and more in the hallway track. It's an interesting experience to once again attend an event as some random person with hardly any connections to other attendees.</li>
</ul>
<p>As always: A big Thank-you to the orgas, speakers, sponsors and attendees!</p>
Things I learned at PGDay Austriahttp://domm.plix.at/perl/2022_09_things_i_learned_at_pgday.html2022-09-19T16:42:27+00:00On Friday 16th the third PGDay Austria took place in Vienna. PGday is a single day PostgreSQL conference with a German and an English track. As I'm using Postgres as my preferred database engine, and <p>On Friday 16th the third <a href="https://pgday.at"><span class="caps">PGD</span>ay Austria</a> took place in Vienna. PGday is a single day PostgreSQL conference with a German and an English track. As I'm using Postgres as my preferred database engine, and also on our <a href="https://balloon-events.com/">most recent project</a> I decided (on rather short notice) to attend.</p>
<p>Here's what I learned:</p>
<ul>
<li>Everybody suffers from the <a href="https://pgday.at/talks/solving-the-knapsack-problem/">knapsack problem</a>, even if you don't know what it is<ul>
<li>Francesco Tisiot used this problem (i.e. packing stuff into your backpack) to give a nice introduction to recursive queries</li>
<li>He has been "fighting against the Excel lobby" for too long (I hear you!)</li>
<li>Besides the hand-drawn images I found it amusing how the font size of the <span class="caps">SQL </span>got smaller during the talk</li>
<li>Postgres 14 has a few nice optimisations (<code>SEARCH</code>, <code>CYCLE</code>)</li>
</ul>
</li>
<li>There are a lot of <a href="https://pgday.at/talks/sinnvolle-postgresql-extensions/">useful Postgres extensions</a> already in contrib (so no need to install extra stuff)<ul>
<li>Even after 20 years of giving talks, Hans-Jürgen Schönig is not safe from projector problems. But having some experience makes it less stressful for the speaker and fun for the audience...</li>
<li><code>pg_stat_statements</code> is a must-have</li>
<li>"The reason for performance problems is always a query" (so logging query stats helps!)</li>
<li>Use <code>citext</code> for case insensitive searches with very little overhead. But: "a little overhead is still better than no result"</li>
<li><code>pg_trgrm</code> for similarity matching using trigrams. Can also be indexed (<code>... USING GIST(col gist_trgm_ops)</code>)</li>
<li><code>copy from program</code> seems nice (though dangerous)</li>
<li>More to check out: <code>pgstattuple</code>, <code>pg_qualstats</code></li>
</ul>
</li>
<li>There is a lot of Open Data available<ul>
<li>Unfortunately a lot if it is in not very usable formats, lacking docs, or can currently only be understood by humans</li>
<li>Karen Jex is working on a way to <a href="https://pgday.at/talks/unlocking-open-data/">Unlock Open Data using an Open Source Database</a></li>
<li>There is a site called <a href="https://findaphd.com">findaphd.com</a> (not I have anything to do with academia)</li>
<li>It's pity we have to spend so much time on figuring out what each open data set means. If only the authors would have spend a little more time to properly document / annotate the data...</li>
</ul>
</li>
<li>One can use <a href="https://pgday.at/talks/pg-hint-plan/">pg_hint_plan</a> for further insights into and hints to the query planer<ul>
<li>I haven't had any need for that yet.</li>
<li>But it's nice that you can use unicode characters for table aliases: <code>select 🍎.name,🍌.price from apple as 🍎 left join banana as 🍌 ...</code></li>
</ul>
</li>
<li>Postgres has a some / a lot <a href="https://pgday.at/talks/postgres-pitfalls/">pitfalls</a><ul>
<li><code>schema public</code> is quite public, so (for postgres < 15) do <code>revoke all on schema public from public;</code></li>
<li>the <code>hba</code> in <code>pg_hba.conf</code> stands for Host Based Access (I was wondering about that for a long time, but always to lazy to look it up..)</li>
<li>better use <code>scram-sha-256</code> than <code>md5</code> in that file</li>
<li><code>bigserial</code> probably makes more sense than <code>serial</code> (IIRC we were using <code>bigserial</code> in a rather old project, but I stopped using it for recent ones, no idea why..)</li>
</ul>
</li>
<li>The <a href="https://pgday.at/talks/strategies-for-optimizing-materialized-views/">Strategies for optimizing materialized views for speed and timeliness</a> seem to mostly apply to <a href="https://www.timescale.com/">TimescaleDB</a><ul>
<li>which looks interesting and I wanted to check it out for some time now</li>
<li><code>REFRESH MATERIALIZED VIEW CONCURRENTLY</code> will probably still be useful.</li>
<li>Another interesting extension: <code>pg_cron</code></li>
</ul>
</li>
<li>I did not find the keynotes especially interesting<ul>
<li>They where mostly sponsor presentations, not the weird masterpieces of talks I'm used to from Perl conferences.</li>
<li>But still, fair enough to give the sponsors some time to present themselves</li>
</ul>
</li>
<li>I did not like the hat in the goodie bag (seems a bit wasteful, and the design will prevent any non-ironic use)</li>
<li>Besides that it was another very nice conference!</li>
</ul>
<p>Thanks to the orgas, speakers, sponsors and attendees!</p>