Note that you can only use the approach described below under limited circumstances because it might affect the performance. The approach must not be applied unless it has been preceded with performance testing.
If your Sitecore XP solution utilizes the Fast Query API, you must maintain the Descendants table in the target database(s). The Publishing Service does not update/rebuild the Descendants table by default. This decision was made to improve the performance of the publishing process. However, you can configure the Publishing Service to allow the Descendants table to be maintained.