i've been pondering question of 2 statements might have higher performance (and why):
select * formelement formid = (select id form name = 'test')
or
select * formelement fe inner join form f on fe.formid = f.id f.name = 'test'
one form contains several form elements, 1 form element part of 1 form.
thanks,
dennis
the performance depends on query plan choosen sql server engine. query plan depends on lot of factors, including (but not limited to) sql, exact table structure, statistics of tables, available indexes, etc.
since 2 queries quite simple, guess result in same (or similar) execution plan, yielding comparable performance.
(for large, complicated queries, exact wording of sql can make difference, book sql tuning dan tow gives lot of great advice on that.)
Comments
Post a Comment