@@ -259,8 +259,6 @@ This means that it is part of the output of the QL program.
259
259
Compiler pragmas
260
260
================
261
261
262
- **Available for **: |characteristic predicates |, |member predicates |, |non-member predicates |
263
-
264
262
The following compiler pragmas affect the compilation and optimization of queries. You
265
263
should avoid using these annotations unless you experience significant performance issues.
266
264
@@ -284,6 +282,8 @@ predicates.
284
282
``pragma[inline] ``
285
283
------------------
286
284
285
+ **Available for **: |characteristic predicates |, |member predicates |, |non-member predicates |
286
+
287
287
The ``pragma[inline] `` annotation tells the QL optimizer to always inline the annotated predicate
288
288
into the places where it is called. This can be useful when a predicate body is very expensive to
289
289
compute entirely, as it ensures that the predicate is evaluated with the other contextual information
@@ -292,6 +292,8 @@ at the places where it is called.
292
292
``pragma[noinline] ``
293
293
--------------------
294
294
295
+ **Available for **: |characteristic predicates |, |member predicates |, |non-member predicates |
296
+
295
297
The ``pragma[noinline] `` annotation is used to prevent a predicate from being inlined into the
296
298
place where it is called. In practice, this annotation is useful when you've already grouped
297
299
certain variables together in a "helper" predicate, to ensure that the relation is evaluated
@@ -301,6 +303,8 @@ work of the helper predicate, so it's a good idea to annotate it with ``pragma[n
301
303
``pragma[nomagic] ``
302
304
-------------------
303
305
306
+ **Available for **: |characteristic predicates |, |member predicates |, |non-member predicates |
307
+
304
308
The ``pragma[nomagic] `` annotation is used to prevent the QL optimizer from performing the "magic sets"
305
309
optimization on a predicate.
306
310
@@ -314,6 +318,8 @@ Note that ``nomagic`` implies ``noinline``.
314
318
``pragma[noopt] ``
315
319
-----------------
316
320
321
+ **Available for **: |characteristic predicates |, |member predicates |, |non-member predicates |
322
+
317
323
The ``pragma[noopt] `` annotation is used to prevent the QL optimizer from optimizing a
318
324
predicate, except when it's absolutely necessary for compilation and evaluation to work.
319
325
@@ -364,7 +370,33 @@ When you use this annotation, be aware of the following issues:
364
370
succ.getSucc() = 3
365
371
)
366
372
}
367
-
373
+
374
+ ``pragma[only_bind_out] ``
375
+ -------------------------
376
+
377
+ **Available for **: |expressions |
378
+
379
+ The ``pragma[only_bind_out] `` annotation lets you specify the direction in which the QL compiler should bind expressions.
380
+ This can be useful to improve performance in rare cases where the QL optimizer orders parts of the QL program in an inefficient way.
381
+
382
+ For example, ``x = pragma[only_bind_out](y) `` is semantically equivalent to ``x = y ``, but has different binding behavior.
383
+ ``x = y `` binds ``x `` from ``y `` and vice versa, while ``x = pragma[only_bind_out](y) `` only binds ``x `` from ``y ``.
384
+
385
+ For more information, see ":ref: `Binding <binding >`."
386
+
387
+ ``pragma[only_bind_into] ``
388
+ --------------------------
389
+
390
+ **Available for **: |expressions |
391
+
392
+ The ``pragma[only_bind_into] `` annotation lets you specify the direction in which the QL compiler should bind expressions.
393
+ This can be useful to improve performance in rare cases where the QL optimizer orders parts of the QL program in an inefficient way.
394
+
395
+ For example, ``x = pragma[only_bind_into](y) `` is semantically equivalent to ``x = y ``, but has different binding behavior.
396
+ ``x = y `` binds ``x `` from ``y `` and vice versa, while ``x = pragma[only_bind_into](y) `` only binds ``y `` from ``x ``.
397
+
398
+ For more information, see ":ref: `Binding <binding >`."
399
+
368
400
.. _language :
369
401
370
402
Language pragmas
@@ -413,4 +445,5 @@ The ``bindingset`` annotation takes a comma-separated list of variables.
413
445
.. |fields | replace :: :ref: `fields <fields >`
414
446
.. |modules | replace :: :ref: `modules <modules >`
415
447
.. |aliases | replace :: :ref: `aliases <aliases >`
416
- .. |algebraic datatypes | replace :: :ref: `algebraic datatypes <algebraic-datatypes >`
448
+ .. |algebraic datatypes | replace :: :ref: `algebraic datatypes <algebraic-datatypes >`
449
+ .. |expressions | replace :: :ref: `expressions <expressions >`
0 commit comments