# Select Dismissal Unexpected Behavior

**URL:** <https://meta.discourse.org/t/select-dismissal-unexpected-behavior/201613>\
**Category:** Product Support\
**Tags:** bulk-actions\
**Created:** [August 24, 2021, 11:34pm UTC](https://meta.discourse.org/t/select-dismissal-unexpected-behavior/201613 "2021-08-24T23:34:52Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![forkythetoy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/forkythetoy/32/199298_2.png) [@forkythetoy](https://meta.discourse.org/u/forkythetoy)\
**Post date:** [August 24, 2021, 11:34pm UTC](https://meta.discourse.org/t/select-dismissal-unexpected-behavior/201613/1 "2021-08-24T23:34:52Z")

</div>

There was a new feature added in May [Selective dismissal of New and Unread topics](https://meta.discourse.org/t/selective-dismissal-of-new-and-unread-topics/191641/1). We recently just upgraded to the latest discourse, and looking at the code and our DB logs, it seems like when users “Dismiss New” without selecting (ie. just bulk dismiss) we pass in tracked = false and nothing else in the request parameters to reset-new.

![image](https://global.discourse-cdn.com/meta/original/3X/3/e/3e7ae4603421e0e4185f2acef9174f437e345702.png)

Inspecting the PR changes I think we end up here when we try to figure out our topic\_scope [FEATURE: Allow selective dismissal of new and unread topics (#12976) · discourse/discourse@7a79bd7 · GitHub](https://github.com/discourse/discourse/commit/7a79bd7da3e0a59454a3c03f3be31e457d0b9fcc#diff-a672ba5c68f4e7842932ef4e0c0893ef55b981e205a2b85490c4ff4363760811R974)

and because we don’t pass in any topic\_ids we skip the if statement and automatically jump to L989

We run a fairly large discourse server, and I think the notion of just having all Topics is pretty expensive as the query basically generates

```plaintext
LEFT JOIN topic_users ON topic_users.topic_id = topics.id AND topic_users.user_id = xxx WHERE "topics"."deleted_at" IS NULL AND "topics"."id" IN (1, ... 1000000) AND (topics.created_at >= 'date') AND (topic_users.last_read_post_number IS NULL) AND (topics.archetype <> 'private_message') ORDER BY topics.created_at DESC LIMIT 500

```

the IN clause has I believe almost every single topic in the 1M+ range.

Can we default the bulk select to just pass in the topic ids instead of defaulting to all possible Topics?

---

_[View the full topic](https://meta.discourse.org/t/select-dismissal-unexpected-behavior/201613)._
