Attempt to optimize ghost generating code.
Summary: Ref T8394, Attempt to optimize ghost generating code.
Test Plan: Open Upcoming, cancelled only, list view query. Should not hang.
Reviewers: epriestley, Blessed Reviewers
Reviewed By: epriestley, Blessed Reviewers
Subscribers: Korvin, epriestley
Maniphest Tasks: T8394
Differential Revision: https://secure.phabricator.com/D13141