SELECT * FROM PRODDTA.F42199 WHERE 1 = 0

aritting

Active Member
While doing a SQL Server profile trace on F42199 I noticed this query quite regularly:
SELECT * FROM PRODDTA.F42199 WHERE 1 = 0
Coming from the jde logic server and DSI's dclink application via the OneWorld fat client login

I noticed this "nonsensical query" happend on many OneWorld tables.

We are currently on the windows/SQL Server platform and I know such a query does not take much resources. However, we are planning on migrating to the Iseries where such a query reads through all the records before returning no result set.
Does anyone no why OneWorld does this, and does it do this on the iseries?
 
I believe that the DB2/UDB query optimizer on the iSeries is being improved anyway to trap nonsensical queries before they run (e.g. WHERE SLDOCO <> SLDOCO). Mind you, I don't know if SQL will try to 'execute' your example as it will detect immediately that the columns 1 and 0 are not valid columns or SQL aliases. Not sure.
 
Does this create a performance overhead on the iseries. I'm became aware of this because it was specifically mentioned as being part of the new SQL Query engine that is evolving in V5R2, however, doing such a query on our iseries V5R2 on a large file resulting in it reading all the records before it returned a zero records (using strsql).
 
Aritting,

I ran your query on my AS400 (V5R2) and the query came back in a second. I also ran SELECT * FROM PRODDTA.F0911 WHERE 1 = 0 (we have 14 million records) and it came back in a second.

We are on V5R2 level 10. What level are you on?

Ryan
 
Just for clarification: Ryan assumed you're on AS400 (he didn't notice you're on MicroSoft's SQL Server), and was questioning on what OS/Version/Level your system is.
Warm regards,
 
Back
Top