Re:JIT-Compiling SQL Queries in PostgreSQL Using LLVM
by darksaints on Monday February 22, 2021 @09:42AM
(#26225041)
After reading through your blog post, I think the feature you should be looking to is expression indexes. Build up the expression that you use repeatedly and and is so costly, and directly index that.
[ Parent
| on HN ]
Re:JIT-Compiling SQL Queries in PostgreSQL Using LLVM
by murkt on Monday February 22, 2021 @11:31AM
(#26226410)
I have thought about expression indexes, and for expressions I need (@> on jsonb) they can't be used.
Re:JIT-Compiling SQL Queries in PostgreSQL Using LLVM
by asah on Monday February 22, 2021 @11:54AM
(#26226737)
Can you wrap that operator call in a function, and index the output of that function?
(sorry if dumb q - but I've used this technique myself, and indeed, my favorite hack in recent years are JavaScript UDFs in plv8... super ugly but very very flexible...)