Chat takes long time to load after upgrading from Legacy Chat to Connect SupportDescriptionA large number of records (for example, 50,000 records) in chat_queue_entry for a specific queue causes a load time more than 15 seconds after upgrading from legacy chat. The load time increase is caused by the system querying all them.Steps to Reproduce In order to see the issue, check how long this queue takes to load: https://demonightlyhelsinki.service-now.com/$chat_support.do?queueID=cd846e1747a102009eaff6df1d9a7175 This issue occurred after creating many records in chat_queue_entry as follows: for (var i = 0 ; i< 20000; i ++){ var gr = new GlideRecord('chat_queue_entry'); gr.queue = 'cd846e1747a102009eaff6df1d9a7175'; gr.short_description = 'testtest'; gr.state = 3; gr.insert();} WorkaroundUse the following script in a before-query business rule on [chat_queue_entry]. Because the delayed loading time is caused when $chat_support.do evaluates too many records on [chat_queue_entry], the script limits the query to all active records and all records created within the last thirty days. The latter condition ensures the user can still view their prior conversations for up to a month while preventing $chat_support.do from evaluating anything older. (function executeRule(current, previous /*null when async*/) { var transaction = GlideTransaction.get(); if (!transaction) return; var page = transaction.getPageName(); if (page.indexOf('api/now/connect/support/collaborators/all') != -1) current.addEncodedQuery('sys_created_on>=javascript:gs.daysAgoStart(30)^ORstateIN1,2'); })(current, previous); Related Problem: PRB714182