Fork me on GitHub
#xtdb
<
2023-03-24
>
Namit Shah02:03:45

In a transaction function, if I want to update multiple documents at once, is there any way to do that? Kind of a bulk update.

refset11:03:41

Hey @U04DDKZJERF yes, you can return multiple put operations from a single function to do this. Bear in mind though that updating lots of documents (i.e. many thousands) in one transaction may noticeably stall progress for concurrent writers as the transaction function must execute serially. Therefore you may want to batch things up across multiple transactions to avoid affecting regular (small) writes.

tatut05:03:28

out of interest, are there any examples of large scale uses of query rules available publicly? my use has mostly been just to get around or-limitations

refset11:03:02

Hey @U11SJ6Q0K I guess it depends what you mean by large 🙂 rules compile to independent subqueries without any re-use of intermediate lookups/calculations, so the query performance will degrade ~linearly with the number of rules (i.e. quite unlike how an explicit "rules engine" like https://github.com/threatgrid/naga works). However the rule definitions themselves are at least compiled and cached. What kind of requirement are you hoping to address? Authz? Some sort of "knowledge graph" inference?

refset11:03:00

The main use case for extensive use of rules with XT that I've personally had sight of is for authz.

tatut11:03:48

Just curious if there are some prolog-y applications

refset13:03:03

kind of related, if you were looking for an excuse to build a flappy bird clone: https://frankiesardo.github.io/minikusari/#!/minikusari.tutorial3

👍 2