**Describe the bug**
It's possible to rewrite CROSS JOIN TO INNER JOIN in certain conditions, but clickhouse doesn't do that when we have ```AND (cond OR cond)``` in WHERE clause.

**Does it reproduce on recent release?**
Yes

**How to reproduce**
Clickhouse version 21.2

```
EXPLAIN SYNTAX
WITH tbl AS
    (
        SELECT *
        FROM numbers(1000)
    )
SELECT count(x.number)
FROM tbl AS x
, tbl AS z
WHERE x.number = z.number

Query id: ea50c6a4-618d-4f87-a089-01ef2ba956fe

┌─explain──────────────────────────────────────┐
│ WITH tbl AS                                  │
│     (                                        │
│         SELECT *                             │
│         FROM numbers(1000)                   │
│     )                                        │
│ SELECT count(number)                         │
│ FROM tbl AS x                                │
│ ALL INNER JOIN tbl AS z ON number = z.number │
│ WHERE number = z.number                      │
└──────────────────────────────────────────────┘


EXPLAIN SYNTAX
WITH tbl AS
    (
        SELECT *
        FROM numbers(1000)
    )
SELECT count(x.number)
FROM tbl AS x
, tbl AS z
WHERE (x.number = z.number) AND ((x.number = 1) OR (x.number = 2))

Query id: 4f3f6e5a-f7fc-41c0-a2f2-675525e5d63e

┌─explain──────────────────────────────────────────────────────┐
│ WITH tbl AS                                                  │
│     (                                                        │
│         SELECT *                                             │
│         FROM numbers(1000)                                   │
│     )                                                        │
│ SELECT count(number)                                         │
│ FROM tbl AS x                                                │
│ CROSS JOIN tbl AS z                                          │
│ WHERE (number = z.number) AND ((number = 1) OR (number = 2)) │
└──────────────────────────────────────────────────────────────┘


EXPLAIN SYNTAX
WITH tbl AS
    (
        SELECT *
        FROM numbers(1000)
    )
SELECT count(x.number)
FROM tbl AS x
, tbl AS z
WHERE (x.number = z.number) AND 1

Query id: 3ba0c863-8432-441a-b04c-e06047436cbc

┌─explain─────────────────────────┐
│ WITH tbl AS                     │
│     (                           │
│         SELECT *                │
│         FROM numbers(1000)      │
│     )                           │
│ SELECT count(number)            │
│ FROM tbl AS x                   │
│ CROSS JOIN tbl AS z             │
│ WHERE (number = z.number) AND 1 │
└─────────────────────────────────┘

```

M(UInt64, max_bytes_before_external_group_by, 0, "", 0) \
    \
    M(UInt64, max_rows_to_sort, 0, "", 0) \
    M(UInt64, max_bytes_to_sort, 0, "", 0) \
    M(OverflowMode, sort_overflow_mode, OverflowMode::THROW, "What to do when the limit is exceeded.", 0) \
    M(UInt64, max_bytes_before_external_sort, 0, "", 0) \
    M(UInt64, max_bytes_before_remerge_sort, 1000000000, "In case of ORDER BY with LIMIT, when memory usage is higher than specified threshold, perform additional steps of merging blocks before final merge to keep just top LIMIT rows.", 0) \
    M(Float, remerge_sort_lowered_memory_bytes_ratio, 2., "If memory usage after remerge does not reduced by this ratio, remerge will be disabled.", 0) \
    \
    M(UInt64, max_result_rows, 0, "Limit on result size in rows. Also checked for intermediate data sent from remote servers.", 0) \
    M(UInt64, max_result_bytes, 0, "Limit on result size in bytes (uncompressed). Also checked for intermediate data sent from remote servers.", 0) \
    M(OverflowMode, result_overflow_mode, OverflowMode::THROW, "What to do when the limit is exceeded.", 0) \
    \
    /* TODO: Check also when merging and finalizing aggregate functions. */ \
    M(Seconds, max_execution_time, 0, "", 0) \
    M(OverflowMode, timeout_overflow_mode, OverflowMode::THROW, "What to do when the limit is exceeded.", 0) \
    \
    M(UInt64, min_execution_speed, 0, "Minimum number of execution rows per second.", 0) \
    M(UInt64, max_execution_speed, 0, "Maximum number of execution rows per second.", 0) \
    M(UInt64, min_execution_speed_bytes, 0, "Minimum number of execution bytes per second.", 0) \
    M(UInt64, max_execution_speed_bytes, 0, "Maximum number of execution bytes per second.", 0) \
    M(Seconds, timeout_before_checking_execution_speed, 10, "Check that the speed is not too low after the specified time has elapsed.", 0) \
    \
    M(UInt64, max_columns_to_read, 0, "", 0) \
    M(UInt64, max_temporary_columns, 0, "", 0) \
    M(UInt64, max_temporary_non_const_columns, 0, "", 0) \
    \
    M(UInt64, max_subquery_depth, 100, "", 0) \
    M(UInt64, max_pipeline_depth, 1000, "", 0) \
    M(UInt64, max_ast_depth, 1000, "Maximum depth of query syntax tree. Checked after parsing.", 0) \