oracle - Would you send this simple SQL back for rework? -
we have web application in users perform ad-hoc queries based on parameters have been entered. might mention response time of high importance users.
the web page dynamically construct sql execute based on parameters entered. example, if user enters "1" "business unit" construct sql this:
select * fact business_unit = '1' --and other criteria based on input params
i found user not specify business_unit following query constructed
select * fact business_unit '%' --and other criteria based on input params
imho, unnecessarily (if not grossly) inefficient , warrants sending code bad modification since have higher rate of sending code rework others, believe may earning reputation being "too picky."
if inappropriate question because not direct coding q, let me know , delete immediately. confused whether subjective questions allowed or not! i'll watching replies.
ty
update:
i using oracle database.
my impression oracle not optimize "like '%'" removing condition , leaving in less efficient. confirm?
although looks grossly inefficient, tested out in sql server, , query optimizer smart enough filter out.
in other words,
select * fact business_unit '%'
and
select * fact
generated exact same query plan. there shouldn't performance difference (depending on db engine guess), although kind of sloppy.
that may affect decision send or not. would, if you're under cloud it's can relax on, @ least in terms of performance.
Comments
Post a Comment