It depends on the data you have in table1.
For example, if the table has two distinct groups, there will be two rows in your select and it will cause the routine to be called twice