Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ℹ️ PR ORDER ℹ️
Develop <- #128 <- #129 <- #125
Performance : would using the hstore module be better ?
In theory : 🚫 | Test : (not done)
The answer was no, for the followng reasons :
Performance : would using another index improve perf ?
In theory : 🆗 | Test : 🚫
No. In theory, HASH index would increase performance however after testing we notice that the tests become around 10% slower (probably due to indexing overhead ?) so it is better to leave default values as they are
Performance : would using prepared statement perf ?
In theory : 🆗 | Test : 🚀 🆗
using prepared statements improved performance by around a huge x5 ! making it comparable with sqlite3 interface
Prepared statements are a good idea since they benefit from caching and remove request processing overhead, which is very useful with our requests that are particularely complex and have a lot of CTE
Performance : fillfactor ?
In theory : 🚫 | Test : ?
Let's think about what the fillfactor serves : avoiding fragmentation problems when we do frequent update. GWrite is subject to do frequent updates on certain scenarios.
However, the WORD_LENGTH is fixed, meaning no update will ever cause fragmentation issues because the "new data" will always have fixed size ! so in theory, the fillfactor should stay 100% like the default. For reasons that are yet not known, a small perf increase was seen with FILLFACTOR set to 90%
Performance : storage mode and compression
In theory : 🆗 | Test : Nothing changed
EXTERNAL storage mode stores data out-of-line in a secondary TOAST table but does not compress it
This is pretty cummon tu use with BYTEA values that do not benefit from compression (cpu sees that the compressed data is bigger than the original data and cancels the compression, which is a waste of cpu time - source and benches )
However, changing those parameters didn't make the tests run faster.
PS : the consisty garantees are not violated with this storage method
Alt approach
This is (for reference only) an alternative approach to do G_write
I has, however, poor performance. So similar approaches are to be avoided ( 857.55s, instead of 120 for 1000 workers )