이런 쿼리 비효율적인가요 아니면 써도 되나요
$sql = "select
idx,
reg_date,
(select blog_title from blog_config_profile where userid=bcm.userid) as blog_title,
(select count(idx) from blog_post where userid=bcm.userid) as post_cnt,
(select count(idx) from blog_chain where userid=bcm.userid) as chain_cnt,
(select sum(out_num) from blog_post where userid=bcm.userid) as out_cnt,
(select sum(reply_num) from blog_post where userid=bcm.userid) as reply_cnt,
status
from blog_config_bs as bcm $where $orderby limit $limits,$limit";
|
댓글을 작성하시려면 로그인이 필요합니다.
로그인
댓글 2개
쿼리속도로 보았을때 않좋을지...
서브쿼리는 처음 사용해보는거라