what's new in postgresql 9.6 and mysql 8.0

32
What’s New In PostgreSQL 9.6 And MySQL 8.0 Baron Schwartz - October 2016

Upload: vividcortex

Post on 14-Apr-2017

298 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: What's New in PostgreSQL 9.6 and MySQL 8.0

What’s New InPostgreSQL 9.6And MySQL 8.0

Baron Schwartz - October 2016

Page 2: What's New in PostgreSQL 9.6 and MySQL 8.0

Introductions & Agenda

Ask questions anytime and/or mention @VividCortex in a tweet, or use #DBUpdates.

Q & A time at the end.

Slides and recording will be posted.

Contact me personally: [email protected] or @xaprb

Page 3: What's New in PostgreSQL 9.6 and MySQL 8.0

A Couple Of ThingsTerminology

● Planner -vs- optimizer

● Standby -vs- slave

● WAL -vs- redo log

● Purge -vs- VACUUM

● Tuple -vs- row

Pronunciation

● “My Sequel” or “My S-Q-L” are both fine

● “Post gress” or “Post gress Q-L” are fine

○ “Post greeee” not so much

Page 4: What's New in PostgreSQL 9.6 and MySQL 8.0

What’s The Status?

PostgreSQL 9.6 was released Sept 29th, and is GA.

● Release Announcement: https://www.postgresql.org/about/news/1703/

MySQL 8.0 is in pre-release status, and some features are “labs.”

● What’s New: https://dev.mysql.com/doc/refman/8.0/en/mysql-nutshell.html

● There’s likely to be a lot more before the GA release.

Page 5: What's New in PostgreSQL 9.6 and MySQL 8.0

HighlightsPostgres 9.6

● Multi-core execution of queries

● Efficiency and Performance

● Extensibility

● Replication and scale-out

MySQL 8.0

● Operability, Reliability, Performance

● Catch-up on SQL support

● Prepare for replica-set sharding

● Document Store (JSON+X Protocol)

NOTE: Builds on significant improvements in 5.7

Page 6: What's New in PostgreSQL 9.6 and MySQL 8.0

Performance: MVCC, Purge, Checkpointing

● MVCC-related capabilities address difficult tradeoffs.

● Edge-case workloads often cause “pauses.”

Page 7: What's New in PostgreSQL 9.6 and MySQL 8.0

Performance: MVCC, Purge, Checkpointing

Postgres 9.6

● Avoid GIN index bloating

● GIN is a generalized inverted index

Page 8: What's New in PostgreSQL 9.6 and MySQL 8.0

Performance: MVCC, Purge, Checkpointing

Postgres 9.6

● Make VACUUM do less wasted work.

● Doesn’t re-VACUUM pages that haven’t changed.

● Big improvement on data warehouse-style servers.

● Big win when data changes only rarely.

Page 9: What's New in PostgreSQL 9.6 and MySQL 8.0

Postgres 9.6

● Timeouts for MVCC snapshots and idle transactions.

○ Both features address related issues.

○ old_snapshot_threshold

○ idle_in_transaction_session_timeout

● Faster visibility checks for new tuples.

Performance: MVCC, Purge, Checkpointing

Page 10: What's New in PostgreSQL 9.6 and MySQL 8.0

Performance: General

Postgres 9.6

● A lot of locking-related performance improvements.

● Big improvements on multicore systems.

● Ordered writes of dirtied pages during checkpointing.

● Ability to instruct the OS to flush more smartly.

Page 11: What's New in PostgreSQL 9.6 and MySQL 8.0

Performance: General

MySQL 8.0

● ALTER TABLE performance improved.

● Temp tables for ALTER aren’t logged to redo log.

● Many other improvements e.g. INFORMATION_SCHEMA.

● Buffer pool mutex is split into several mutexes.

Page 12: What's New in PostgreSQL 9.6 and MySQL 8.0

Indexing Improvements

Postgres 9.6

● Improvements for GiST indexes.

● Improvements for GIN indexes.

● More efficient index-only scans.

Page 13: What's New in PostgreSQL 9.6 and MySQL 8.0

MySQL 8.0

● Support for indexing columns in descending order.

● Improves queries where mixed-order indexing helps.

● Note - backwards index scans have always worked.

Indexing Improvements

Page 14: What's New in PostgreSQL 9.6 and MySQL 8.0

Planning / Query Optimization

Postgres 9.6

● Better column statistics.

● Better selectivity estimates.

Page 15: What's New in PostgreSQL 9.6 and MySQL 8.0

Planning / Query Optimization

MySQL 8.0

● More robust optimizer hints.

● Invisible indexes.

● Better optimizer statistics and histograms.

Page 16: What's New in PostgreSQL 9.6 and MySQL 8.0

Replication

Postgres 9.6

● Better observability for replication slots.

● Reserved replication slots.

● Multiple standbys for sync replication.

○ Configurable number for acking commits.

● New setting to ensure transactions are applied.

Page 17: What's New in PostgreSQL 9.6 and MySQL 8.0

Postgres 9.6

● Improvements to start a new standby from a base backup.

● Ability to rewind a standby to a previous state.

● Many indirect improvements to replication.

○ Example - improved locking

Replication

Page 18: What's New in PostgreSQL 9.6 and MySQL 8.0

MySQL 8.0

● Group Replication is making rapid progress.

Replication

Page 19: What's New in PostgreSQL 9.6 and MySQL 8.0

ObservabilityPostgres 9.6

● More pg_stat_… views

○ VACUUM observability

○ Replication

○ Blocking/blockers

● Internally: wait events

○ Basis for future improvement

Page 20: What's New in PostgreSQL 9.6 and MySQL 8.0

Observability

MySQL 8.0

● Much faster INFORMATION_SCHEMA

● PERFORMANCE_SCHEMA has indexes now

● Errors are instrumented in P_S

● Buffer pool index pages inspectability

● Slightly better insight into row-based replication apply

Page 21: What's New in PostgreSQL 9.6 and MySQL 8.0

Authentication and Security

Postgres 9.6

● More sophisticated integration with external auth.

● More built-in roles that can do useful things.

Page 22: What's New in PostgreSQL 9.6 and MySQL 8.0

Authentication and Security

MySQL 8.0

● Adds ROLEs.

Page 23: What's New in PostgreSQL 9.6 and MySQL 8.0

OperabilityPostgres 9.6

● Easier to create a standby from a base backup.

● Monitoring/observability improvements.

● Easier to see things like config options.

● More reliable replication.

○ Replication improvement = recovery improvement.

● Transaction timeouts.

Page 24: What's New in PostgreSQL 9.6 and MySQL 8.0

Operability

MySQL 8.0

● New transactional data dictionary.

● Atomic DDL operations.

● Persistent auto-increment values.

● Persistent configuration changes.

● Great foundation for future work, paying off tech debt.

Page 25: What's New in PostgreSQL 9.6 and MySQL 8.0

Document Database Support

Postgres 9.6

● Added JSONB_INSERT()

Page 26: What's New in PostgreSQL 9.6 and MySQL 8.0

Document Database Support

MySQL 8.0

● Added ->> operator for JSON

● Added JSON_ARRAYAGG() and JSON_OBJECTAGG()

● The “X Protocol” continues to be developed

● Improvements in MemcacheD protocol

Page 27: What's New in PostgreSQL 9.6 and MySQL 8.0

Scalability and Scale-Out

Postgres 9.6

● Foreign Data Wrappers (FDW) are much more capable.

○ Allows UPDATE, DELETE

○ Allows JOIN, sorting

● Foundation for inter-server collaboration/coordination.

Page 28: What's New in PostgreSQL 9.6 and MySQL 8.0

Scalability and Scale-Out

MySQL 8.0

● Group replication headed towards a top-level feature.

● Begins to introduce the notion of a “sharded replica set.”

NB: MongoDB is the clear leader over both MySQL and Postgres in “sharding” and “replica set” scale-out.

Page 29: What's New in PostgreSQL 9.6 and MySQL 8.0

Other Notable Improvements

Postgres 9.6

● Improved full-text-search (FTS) support

○ Phrase, proximity, ordering

Page 30: What's New in PostgreSQL 9.6 and MySQL 8.0

Other Notable Improvements

MySQL 8.0

● Common Table Expressions (CTEs)

● Both recursive and non-recursive

● No windowing functions yet

Page 31: What's New in PostgreSQL 9.6 and MySQL 8.0

No More Wrong MagicMySQL 8.0 removes the ER_WRONG_MAGIC error.

Now you know.

Page 32: What's New in PostgreSQL 9.6 and MySQL 8.0

Question & Answer & Upcoming

My contact info again - [email protected] / @xaprb