Hi @ahmed salah ,
Try:
CREATE INDEX index1 ON package2 (packageId);
A tip to increase JOIN performance: in SQL you should always put a non-clustered index on a foreign key column.
So if you have a table package, it probably has a primary key something like packageId. SQL Server will put an index on that automatically.
However, if you have a table packageId2 that has a foreign key relationship with packageId, there is by default no index on the column packageId2.packageId. But such an index is very useful and helpful for joins and lookups, so that's a best practice : put an index on all your foreign key columns in a table.
Regards,
Echo
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".