powerprinting
MIS
I understand that SQL statements are optimized when you include a WHERE statement as long as there exists an index on the fields you specify in the condition. Does it follow that this statement is not optimized?
select * from mytable;
inner join zfield2 on zfield2.thisfield=mytable.thisfield;
inner join zfield2 on zfield2.thisfield=mytable.zfield;
My question is would my statement better optimized for speed if I add a WHERE to it?
FYI, If it interests anyone, I've also learned that if you have deleted records in a database and you want optimization, it helps to have a an index on deleted ex: index on deleted() tag delrec. This is only if deleted is set to 'on'. If 'off', its aleady optimal.
select * from mytable;
inner join zfield2 on zfield2.thisfield=mytable.thisfield;
inner join zfield2 on zfield2.thisfield=mytable.zfield;
My question is would my statement better optimized for speed if I add a WHERE to it?
FYI, If it interests anyone, I've also learned that if you have deleted records in a database and you want optimization, it helps to have a an index on deleted ex: index on deleted() tag delrec. This is only if deleted is set to 'on'. If 'off', its aleady optimal.