Here's the SQL for related_comments.count:
related_comments.count
(22.0ms) SELECT COUNT(*) FROM ( (SELECT "comments".* FROM "comments" WHERE (("comments"."ancestry" LIKE '12/%' OR "comments"."ancestry" = '12') OR "comments"."id" = 12)) UNION (SELECT "comments".* FROM "comments" WHERE 1=0 ORDER BY COALESCE("comments"."ancestry", '') ASC) ) "comments" WHERE "comments"."user_id" = $1 [["user_id", 11]] [sql_query]
And for the select:
select
(4.1ms) SELECT "comments".* FROM ( (SELECT "comments".* FROM "comments" WHERE (("comments"."ancestry" LIKE '12/%' OR "comments"."ancestry" = '12') OR "comments"."id" = 12)) UNION (SELECT "comments".* FROM "comments" WHERE 1=0 ORDER BY COALESCE("comments"."ancestry", '') ASC) ) "comments" WHERE "comments"."user_id" = $1 [["user_id", 11]] [sql_query]
FWIW the code I'm using does not run related_comments.count; that was to demonstrate how many records should be updated.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Here's the SQL for
related_comments.count
:And for the
select
:FWIW the code I'm using does not run
related_comments.count
; that was to demonstrate how many records should be updated.