Why discuss single view performance, when it all comes down to how Gramps use the database backend?
It is no point to hack some list-order code or a cache parameter (yes, it can be a temporary workaround) if you want the performance to be better on the long term.
BUT, to change from one database system to another takes some time and either the developer doing the job, just has to make a totally new version and let the old one just “run and float around”, or they need to do as they have done with Gramps, do it in steps.
Gramps have now changed the main database-backend, the next step is naturally to change from blobs (no point to use in a relation database unless it is extremely large binary data) to JSON or to spilt the data into multiple tables (actually no need to do so with the JSON support in sqlite and postgresql and most other relation databases today).
The next major step after the change to JSON objects stored in a JSON table, would be to create some indexes and views as a minimum, and maybe also som functions for handling the most common tasks, e.g., some of the simpler searches/filters etc. and change the Gramps code to utilize those features in the database backend.
there is no need to create the most advanced SQL-functions and stored-procedures and to split up the serialized objects, to speed up most of the main functions/features of Gramps, and by keeping it simple, it will also be possible to utilize much, if not all, of the same code for different backends, e.g., earlier mentioned multi-format databases that do support much of the common SQL language…
One of the reasons for why it is not necessary to split the JSON-objects stored in a JSON-column is because of the way we use attributes, with a JSON object we can store the attributes for an object dynamically, just as in a document- or graph database, instead of having a table with attributes and multiple “reference tables”.
So, when you save a JSON-object to the database, one object can have 50 attributes, the next same type object can have 10000 attributes and you will not need to change the database structure in any way, e.g., extend a table with more columns.
Two other features that can be used to really speed up things is multi-thread and multi-CPU usage… Not linear, but the benefits can be huge for the right type of data, I/O and data-processing…
Dream situation would be to have a configuration like:
- How many threads =
- How many CPUs/Cores to use =
That way it would have been possible to test out the best scenario for any hardware combination.
But seriously… who have a billion entries in the database… and absolutely no time to use?