You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by "hgaol (via GitHub)" <gi...@apache.org> on 2025/04/15 14:07:08 UTC

[PR] fix: dedup questions in GetQuestionPage [answer]

hgaol opened a new pull request, #1311:
URL: https://github.com/apache/answer/pull/1311

   Close #1310 .
   
   I planned to use `session.Distinct("question.*")` but met error when it execute `FindAndCount` in Help func. The current approach works for `FindAndCount`. The SQL looks like
   
   ```sql
   [xorm] [info]  2025/04/15 22:00:52.962709 [SQL] SELECT question.* FROM `question` LEFT JOIN `tag_rel` ON question.id = tag_rel.object_id WHERE `question`.`status` IN (?,?) AND `tag_rel`.`tag_id` IN (?,?,?) AND (tag_rel.status = ?) AND (question.show = ?) GROUP BY question.id ORDER BY question.pin desc,question.created_at DESC LIMIT 10 [1 2 10030000000000041 10030000000000042 10030000000000002 1 1] - 737.525µs
   
   [xorm] [info]  2025/04/15 22:00:52.963977 [SQL] SELECT count(*) FROM (SELECT question.id FROM `question` LEFT JOIN `tag_rel` ON question.id = tag_rel.object_id WHERE `question`.`status` IN (?,?) AND `tag_rel`.`tag_id` IN (?,?,?) AND (tag_rel.status = ?) AND (question.show = ?) GROUP BY question.id) sub [1 2 10030000000000041 10030000000000042 10030000000000002 1 1] - 418.635µs
   ```
   
   <img width="1110" alt="image" src="https://github.com/user-attachments/assets/40b73f89-0618-4c3b-991d-cb9a73c9bfef" />
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: dedup questions in GetQuestionPage [answer]

Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
LinkinStars merged PR #1311:
URL: https://github.com/apache/answer/pull/1311


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org