I have a base view pointing to a single MSSQL table. The table has a clustered index. The table has approximately 6 million rows in it.
When I run the query from DBeaver using a simple where clause I get the same expected result as when I run the query from MSSQL. The result is returned instantly.
```
select *
from MyTable AS k01
where k01.p_logicaldate = '03 Jan 2017 12:00:00 AM'
and k01.p_todate = '03 Jan 2017 12:00:00 AM'
and k01.brk_cde = 9 and k01.acc_cde = 4
```
However when I extend the query like below the query being run from DBeaver eventually times out. The same query in MSSQL returns results instantly. It seems to me that the query being submiitted to Denodo from DBeaver is incorrect and is completely excluding part of the where clause..
```
select *
from MyTable AS k01
where k01.p_logicaldate = '03 Jan 2017 12:00:00 AM'
and k01.p_todate = '03 Jan 2017 12:00:00 AM'
and ((k01.brk_cde = 9 and k01.acc_cde = 4) OR (k01.brk_cde = 48 and k01.acc_cde = 2004))
```
I ran SQL profiler and got the following result
```
declare @p1 int
set @p1=0
exec sp_prepexec @p1 output,N'@P0 datetime2,@P1 datetime2',N'SELECT t0.BRK_CDE, t0.ACC_CDE FROM BDAVault.dbo.K01 t0 WHERE t0.K01SysEFD <= coalesce(@P0, t0.K01SysEFD, null) AND (t0.K01SysETD IS NULL OR t0.K01SysETD >= coalesce(@P1, t0.K01SysETD, null)) ','2017-01-03 00:00:00','2017-01-03 00:00:00'
select @p1
```
As can be seen the query being submitted is leaving out the filter part of the where clause
```
and ((k01.brk_cde = 9 and k01.acc_cde = 4) OR (k01.brk_cde = 48 and k01.acc_cde = 2004))
```
The clustered index is based on the dates, brk_cde and acc_cde
Thank you in advance.