There are 2 types of create buttons in Confluence: Quick create (to create a page) and Blueprint create (will bring up a Create dialog with blueprint options). In order to decide if these buttons should be visible or not, for every page load, Confluence has to execute several DB queries to scan all SPACES and SPACEPERMISSIONS tables to find any spaces in which current user has permission to create page/blogpost. You can find a sample query below:
These permission queries don't scale well, especially in MySQL. Below you can find average query time for a dataset of about 6,000 spaces and 300,000 records in SPACEPERMISSIONS table:
|DBMS||Avg query time (ms)|
Not only expensive, the number of these queries is also unnecessary high. See below for count for each page type and type of Create buttons:
Under very high load, these queries can put enormous pressure on DB and may even cause outages.
The code to render Create buttons doesn't scale well because it involves too many queries which can be costly in big instances. This ticket aims to alleviate some problems in CONFSERVER-57535 while the proper fix is being considered.
Currently there is no known workaround for this behavior. A workaround will be added here when available