Improve performance when sorting namespaces by created_at and updated_at column

There's an ongoing performance issues when sorting namespaces by created_at or updated_at column due to the lack of database indexes. This issue is focused on identifying solutions around this restriction.

We cannot directly add these because the namespaces table already exceeds the 15 maximum index limit.

Possible Solutions

No particular ordering. These needs further evaluation.

  1. Delegate the sorting column to namespace_details.created_at and namespace_details.updated_at
  2. Move other namespaces table columns with an index to other tables. Providing room for these indices (source)

Checklist (Acceptance Criteria)

Edited by Shane Maglangit