• Probably best to post the DDL of all tables/views involved.

    What size is the loginlog table ? It has a clustered index scan which migth be costly depending on its size.