我有这个查询
select count(distinct user1_.Id) as col_0_0_ from [FriendCloseness] friendclos0_ inner join [User] user1_ on friendclos0_.User_id=user1_.Id where dateadd(d, 0, datediff(d, 0, friendclos0_.LastUpdate))=@p0 and friendclos0_.IsInvited=1 and user1_.IsDeleted=0 and user1_.Sex=@p1
表用户加入 FriendCloseness 查询 FriendClossness 字段 LastUpdate、IsInvited、用户字段 IsDeleted、Sex where
涉及查询的表用户结构
User Id,(Primary key) IsDeleted, Sex,
FriendClossness Id,(主键,DBMS会自动设置索引为主键吗?) LastUpdate (datetimeoffset), IsInvited, User_id (外键)
我知道我需要索引哪个字段,我想通过创建新字段“InviteDate”来删除日期函数以仅存储日期