In case you do not have any indexes on the table, the first query will take slightly more time, it is because nothing can be taken from memory, but you have to check two fields instead of one.
But this kind of denormalization is indeed very useful when you can add your own indexes. You can add just (block)
index, so that the equality check would be done in memory, and the data for the second condition would be taken from the disk, but only for those rows that matched the first condition. This is especially useful when most of the rows the match the first condition match the second as well.
From the other side, you can add (codeno(1))
index, and the index would be used for the prefix check like codeno like 'b%'
(be sure to specify the long enough prefix in the index), and this would take almost the same time. In this case the condition block='b'
is not required, and even impedes.