Quantcast
Channel: SCN: Message List - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 3587

Re: False condition in WHERE clause

$
0
0

See full reproduction of the problem attached, you can try the same on your environment. You can use a regular table instead the temporary one, the result will be the same. Statistics on the table are up-to-date.

 

My test looks like this (with and without the second condition):

 

select id, name into #sysobjects from sysobjects

go

create unique index idx1 on #sysobjects(id)

go

 

dbcc traceon(3604)

go

set statement_cache off

go

set showplan on

go

set statistics io on

go

set statistics plancost on

go

set option show_lio_costing on

go

select * from #sysobjects

where id = 7 or 7 = 0

go

set showplan off

go

set option show_lio_costing off

go

set statistics io off

go

set statistics plancost off

go

 

 

Thanks

Leonid Gvirtz


Viewing all articles
Browse latest Browse all 3587

Trending Articles