]> git.openstreetmap.org Git - rails.git/commit
Split text search of notes and note comments in two
authorTom Hughes <tom@compton.nu>
Mon, 13 Apr 2026 21:36:24 +0000 (22:36 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 13 Apr 2026 21:36:24 +0000 (22:36 +0100)
commitd33eb9a0d0d2623fc598ae063657139629a62a20
treec34c34d911df25dd7bd1e86a7d8b20ae65118fc8
parent96c2e81cca1deb69ebbccb45d2eca19a7cb93ee5
Split text search of notes and note comments in two

Postgres isn't able to figure out how to optimise the text search
using the GIN indexes when presented with an OR that needs to search
both tables but if we split the query in two ourselves and merge them
back together with a union then it can use the indexes which can speed
things up by two orders of magnitude.
app/controllers/api/notes_controller.rb