Merge/Join nodes together as optimisation
- Dominant language
- Python
- Stars
- 30
- Forks
- 3
- Avg merge
- 9h 28m
- Merged PRs (30d)
- 42
Description
A common pattern is:
```
A
/ \
B C
\ /
Merge
```
We have plans to try and optimise that - ie #240
But another option would be to be able to join nodes together into a single node (nodes are OR'd together)
```
A
|
BC
```
This would be *much* faster: only need to do 1 count calculation rather than 3, and can optimise query to
```
q = reduce(operator.or_, [n._get_node_q() for n in nodes])
```
It also reduces the complexity of the filters, ie if you never care about the individual results only the merged ones.
It kind of also makes sense to join nodes vertically together and apply them as an and operation (ie 1 filter applied after the other)
```
A
|
B
|
C
```
to:
```
A
|
B
C
```
This would remove a count operation (and some visual space)
UI would be to drag + select the nodes and then click toolbar button - 2 arrows pointing together (horizontally or vertically) then those nodes are set to invisible, and a new node appears that represents all of them OR'd together. If you click on toolbar button of 2 arrows pointing apart, the invisible nodes are moved to the joined nodes position then set to visible again and joined node disappears.
If they all have common ancestor, could keep that attachment, otherwise just destroy attachments
Might be easier to not have an editor, or you could make an editor that has icons of the nodes you joined together, and clicking on them opens up the editor for the invisible nodes
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.