CAST Storage Service (CSS) 3 is a re-packaged PostgreSQL 9.6.11, while CAST Storage Service 4 uses PostgreSQL 13. Since the the EOL for PostgreSQL 9.6.x is scheduled for November 2021, CAST would encourage you to upgrade your instance wherever possible. Over and above the benefits of using a PostgreSQL release that is not due to go EOL until November 2025, the improvements added to PostgreSQL between 9.6 and 13 are worth highlighting - these improvements also provide better performance for use with CAST AIP.The The major benefits are listed below:.
|Note that CAST routinely recommends using PostgreSQL on Linux, rather than CAST Storage Service on Microsoft Windows since performance is always better.|
Schema size on disk
The default CAST AIP schemas created on a CSS4/PostgreSQL 13 instance are smaller in size when compared to the same schemas created on a CSS3/PostgreSQL 9.6.x instance. This is primarily due to the fact that index storage handling has improved in PostgreSQL 13: the B-tree index takes up less space on disk.
The built in VACUUM process is much faster on CSS4/PostgreSQL 13 because of the ability to vacuum indexes in parallel which was not supported in CSS3/PostgreSQL 9.6.x (you can run a VACUUM process directly in AIP Console - see Administration Center - Settings - CSS Optimization). If you are running VACUUM manually using PgAdmin or an equivalent tool, you can also specify the PARALLEL directive to control how many parallel VACUUM jobs you want running on your indexes - see https://www.postgresql.org/docs/current/sql-vacuum.html.
Query performance has been improved in CSS4/PostgreSQL 13 because incremental sort has been implemented for multi-column sorts. This performance improvement is easily highlighted using the following query executed on both CSS4/PostgreSQL 13 and CSS3/PostgreSQL 9.6:
DROP TABLE IF EXISTS abc; CREATE TABLE abc (x int PRIMARY KEY, y int); CREATE INDEX ON abc (y); INSERT INTO abc SELECT x, x % 16378 FROM generate_series(1,1000000) x; DROP TABLE IF EXISTS abc; CREATE TABLE abc (x int PRIMARY KEY, y int); CREATE INDEX ON abc (y); INSERT INTO abc SELECT x, x % 16378 FROM generate_series(1,1000000) x; SELECT pg_size_pretty(pg_relation_size('abc_y_idx')); -- Get the size of index EXPLAIN ANALYZE SELECT count(*) FROM abc WHERE y = 50; DROP INDEX abc_y_idx; ANALYZE abc; EXPLAIN ANALYZE SELECT * FROM abc WHERE x % 13 = 0 ORDER BY x, y DESC LIMIT 13;