**Describe the bug**
Trivially reusable intermediates are not reused.

**To Reproduce**
```sql

start transaction;

-- a small table
create table t(value int);
insert into t values (0),(2),(1);

explain
SELECT * from t where value=0
UNION ALL
SELECT * from t where value=0;
```
The explain shows two distinct `bind`s for the same column. Which means two distinct selects that are in fact identical. In real queries this can explode.

```
| function user.main():void;                                                                                                                               |
|     X_1:void := querylog.define("explain\nselect * from t where value=0\nunion all\nselect * from t where value=0;":str, "sequential_pipe":str, 22:int); |
|     X_4:int := sql.mvc();                                                                                                                                |
|     C_5:bat[:oid] := sql.tid(X_4:int, "sys":str, "t":str);                                                                                               |
|     X_8:bat[:int] := sql.bind(X_4:int, "sys":str, "t":str, "value":str, 0:int);                                                                          |
|     C_13:bat[:oid] := algebra.thetaselect(X_8:bat[:int], C_5:bat[:oid], 0:int, "==":str);                                                                |
|     X_15:bat[:int] := algebra.projection(C_13:bat[:oid], X_8:bat[:int]);                                                                                 |
|     X_17:bat[:int] := sql.bind(X_4:int, "sys":str, "t":str, "value":str, 0:int);                                                                         |
|     C_19:bat[:oid] := algebra.thetaselect(X_17:bat[:int], C_5:bat[:oid], 0:int, "==":str);                                                               |
|     X_20:bat[:int] := algebra.projection(C_19:bat[:oid], X_17:bat[:int]);                                                                                |
|     X_21:bat[:int] := bat.new(nil:int);                                                                                                                  |
|     X_23:bat[:int] := bat.append(X_21:bat[:int], X_15:bat[:int], true:bit);                                                                              |
|     X_25:bat[:int] := bat.append(X_23:bat[:int], X_20:bat[:int], true:bit);                                                                              |
|     X_27:bat[:str] := bat.pack(".%5":str);                                                                                                               |
|     X_28:bat[:str] := bat.pack("value":str);                                                                                                             |
|     X_29:bat[:str] := bat.pack("int":str);                                                                                                               |
|     X_30:bat[:int] := bat.pack(32:int);                                                                                                                  |
|     X_31:bat[:int] := bat.pack(0:int);                                                                                                                   |
|     X_26:int := sql.resultSet(X_27:bat[:str], X_28:bat[:str], X_29:bat[:str], X_30:bat[:int], X_31:bat[:int], X_25:bat[:int]);                           |
| end user.main;                                                                                                                                           |
```
**Expected behavior**
Only one `bind` to column `value` is made and the associated variable used twice, leading to only one select.

**Software versions**
 - MonetDB version number 11.49.6
 - OS and version: Fedora 39
 - self-installed and compiled

commonTerms optimizer no longer works
This is a GitHub Issue
repo:MonetDB
owner:MonetDB
Title : commonTerms optimizer no longer works
Issue date:

--- start body ---
**Describe the bug**
Trivially reusable intermediates are not reused.

**To Reproduce**
```sql

start transaction;

-- a small table
create table t(value int);
insert into t values (0),(2),(1);

explain
SELECT * from t where value=0
UNION ALL
SELECT * from t where value=0;
```
The explain shows two distinct `bind`s for the same column. Which means two distinct selects that are in fact identical. In real queries this can explode.

```
| function user.main():void;                                                                                                                               |
|     X_1:void := querylog.define("explain\nselect * from t where value=0\nunion all\nselect * from t where value=0;":str, "sequential_pipe":str, 22:int); |
|     X_4:int := sql.mvc();                                                                                                                                |
|     C_5:bat[:oid] := sql.tid(X_4:int, "sys":str, "t":str);                                                                                               |
|     X_8:bat[:int] := sql.bind(X_4:int, "sys":str, "t":str, "value":str, 0:int);                                                                          |
|     C_13:bat[:oid] := algebra.thetaselect(X_8:bat[:int], C_5:bat[:oid], 0:int, "==":str);                                                                |
|     X_15:bat[:int] := algebra.projection(C_13:bat[:oid], X_8:bat[:int]);                                                                                 |
|     X_17:bat[:int] := sql.bind(X_4:int, "sys":str, "t":str, "value":str, 0:int);                                                                         |
|     C_19:bat[:oid] := algebra.thetaselect(X_17:bat[:int], C_5:bat[:oid], 0:int, "==":str);                                                               |
|     X_20:bat[:int] := algebra.projection(C_19:bat[:oid], X_17:bat[:int]);                                                                                |
|     X_21:bat[:int] := bat.new(nil:int);                                                                                                                  |
|     X_23:bat[:int] := bat.append(X_21:bat[:int], X_15:bat[:int], true:bit);                                                                              |
|     X_25:bat[:int] := bat.append(X_23:bat[:int], X_20:bat[:int], true:bit);                                                                              |
|     X_27:bat[:str] := bat.pack(".%5":str);                                                                                                               |
|     X_28:bat[:str] := bat.pack("value":str);                                                                                                             |
|     X_29:bat[:str] := bat.pack("int":str);                                                                                                               |
|     X_30:bat[:int] := bat.pack(32:int);                                                                                                                  |
|     X_31:bat[:int] := bat.pack(0:int);                                                                                                                   |
|     X_26:int := sql.resultSet(X_27:bat[:str], X_28:bat[:str], X_29:bat[:str], X_30:bat[:int], X_31:bat[:int], X_25:bat[:int]);                           |
| end user.main;                                                                                                                                           |
```
**Expected behavior**
Only one `bind` to column `value` is made and the associated variable used twice, leading to only one select.

**Software versions**
 - MonetDB version number 11.49.6
 - OS and version: Fedora 39
 - self-installed and compiled

--- end body ---
