select sql_no_cache from Posts as p
join (
select from PostMember
where 1 = 1 and MemberId in ( 33,34,35,36,40,44,45,46,47,48,49,53,54)
group by PostId
) as pm on pm.PostId = p.id
join Folders as l on l.PostId = p.id
where 1 = 1 and l.UserId in (162777)


select sql_no_cache /! straight_join / *
from Folders as l
join (
select PostId, MemberId from PostMember
where MemberId in ( 33,34,35,36,40,44,45,46,47,48,49,53,54)
) as pm on l.PostId = pm.PostId
join Posts as p on l.PostId = p.id
where 1 = 1 and l.UserId in (162777)


select sql_no_cache count(1) as cnt, p.id as PostId, p.img, p.UserId, u.nick, u.profileImg, p.thumb_width, p.thumb_height, p.CONVS_STUS,
u.UserId as vpId, p.format
from Posts as p
join Folders as l on l.PostId = p.id
join (
select * from PostMember
where MemberId in (33,34,35,36,40,44,45,46,47,48,49,53,54)
group by PostId
) as pm on pm.PostId = p.id
join Users as u on u.id = p.UserId
where l.createdAt >= '2022-11-06 15:00:00' and l.createdAt <= '2022-11-13 15:00:00'
group by p.id


select sql_no_cache /! straight_join / count(1) as cnt, p.id as PostId, p.img, u.UserId, u.nick, u.profileImg, p.thumb_width, p.thumb_height, p.CONVS_STUS,
u.UserId as vpId, p.format
from (
select PostId from PostMember
where MemberId in (33,34,35,36,40,44,45,46,47,48,49,53,54)
group by PostId order by null
) as pm
join Folders as l on pm.PostId = l.PostId
join Posts as p on l.PostId = p.id
join Users as u on p.UserId = u.id
where l.createdAt >= '2022-11-06 15:00:00' and l.createdAt <= '2022-11-13 15:00:00'
group by l.PostId
order by null


select p.id, img, format, p.content, u.id as userId, u.id as UserId, p.thumb_width, p.thumb_height, p.createdAt ,p.CONVS_STUS
from Posts as p
join Users as u on u.id = p.UserId and u.type = 1 and deletedAt is null
join PostMember as pm on pm.PostId = p.id
and pm.MemberId in (125, 124, 123, 122, 121, 120, 119, 118) where 1 = 1 and u.status = 2
group by p.id order by p.id desc limit 0, 40;


select sql_no_cache p.id, img, format, p.content, u.id as userId, u.id as UserIdd, p.thumb_width, p.thumb_height, p.createdAt , p.CONVS_STUS
from (select UserId, id, id2, img, format, content, thumb_width, thumb_height, createdAt, CONVS_STUS from (select pp1.id from Posts as pp1 join PostMember as pm on pm.PostId = pp1.id where MemberId in (223,224,225,226,228,230,231,232,249) group by pp1.id order by pp1.id desc limit 10000, 40 ) as p1
join (select UserId, id as id2, img, format, content, thumb_width, thumb_height, createdAt, CONVS_STUS from Posts) as p2 on p1.id = p2.id2) as p
join Users as u on u.id = p.UserId and u.type = 1 and u.status = 2


select sql_no_cache u.*, um.MemberId
from Users as u
join UserMember as um on um.UserId = u.id
where um.MemberId in (125, 124, 123, 122, 121, 120, 119, 118)
and u.market_push = 1
group by u.id, um.MemberId
order by null


select sql_no_cache id, disturb_s, disturb_e, disturb, fcmTocken, langType
from Users as u
left join (select UserId, MemberId from UserMember where MemberId in (125, 124, 123, 122, 121, 120, 119, 118)) as um
on u.id = um.UserId
where um.UserId is not null
and u.market_push = 1


select sql_no_cache f.*, u.rest from FollowingVps as f
join VpMember as vm on vm.UserId = f.followingId
join Member as m on m.id = f.MemberId
join Users as u on u.id = f.followingId
where 1 = 1 and f.userId in (336)
group by followingId, f.userId, m.id


select sql_no_cache f.*, u.rest
from FollowingVps as f
join Users as u on u.id = f.followingId
where 1 = 1 and f.userId in (336)
group by f.followingId, f.userId, f.memberId
