└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # Awesome PostgreSQL resources 2 | A curated list of awesome resources to understand PostgreSQL. Inspired by [awesome-postgres](https://github.com/dhamaniasad/awesome-postgres) 3 | 4 | This is a WIP, contributions are welcome! 5 | 6 | ## Contents 7 | 8 | * [Administration](#administration) 9 | * [Hacking postgres](#hacking_postgres) 10 | * [Internals](#internals) 11 | * [SQL](#sql) 12 | 13 | ## Administration 14 | 15 | * [Autovacuum, explained for engineers](http://blog.postgresql-consulting.com/2015/10/autovacuum-explained-for-engineers-new.html) 16 | A presentation describing autovacuum. 17 | Ilya Kosmodemiansky, 2015 18 | 19 | * [Common misconceptions about locking in PostgreSQL](https://www.compose.com/articles/common-misconceptions-about-locking-in-postgresql/) 20 | A blog post clarifying locks in PostgreSQL. 21 | Robert Wysocki, 2015 22 | 23 | * [It's a view, it's a table... no, it's a materialized view!](https://www.compose.com/articles/its-a-view-its-a-table-no-its-a-materialized-view/) 24 | A fairly complete introduction to materialized views. 25 | Robert Wysocki, 2015 26 | 27 | * [Postgres autovacuum is not the enemy](https://www.citusdata.com/blog/2016/11/04/autovacuum-not-the-enemy/) 28 | A blog post explaining the rationale behind autovacuum. 29 | Joe Nelson, 2016 30 | 31 | * [PostgreSQL monitoring cheatsheet](https://russ.garrett.co.uk/2015/10/02/postgres-monitoring-cheatsheet/) 32 | A blog post listing some useful metrics when monitoring PostgreSQL. 33 | Russ Garett, 2015 34 | 35 | * [PostgreSQL primary key type analysis](http://gosimple.me/postgresql-primary-key-type-analysis/) 36 | A blog post comparing the performance of primary keys using integer sequences 37 | and various UUID generation methods. 38 | Adam Brusselback, 2016 39 | 40 | ## Hacking postgres 41 | 42 | * [Hacking PostgreSQL](https://www.postgresql.eu/events/pgconfeu2018/sessions/session/2058/slides/96/hackingpg-present.pdf) 43 | A conference presentation that gives an overview of PostgreSQL's source code, 44 | some important structures, and other useful info to get started in hacking 45 | postgres. 46 | Stephen Frost, 2018 47 | 48 | * [Introduction to MemoryContexts](http://blog.pgaddict.com/posts/introduction-to-memory-contexts) 49 | [AllocationSet internals](http://blog.pgaddict.com/posts/allocation-set-internals) 50 | [Examples of palloc overhead](http://blog.pgaddict.com/posts/palloc-overhead-examples) 51 | [How much benefit do we get from Allocation set?](http://blog.pgaddict.com/posts/how-much-benefit-do-we-get-from-allocation-set) 52 | A series of blog posts explaining the rationale behind `palloc` (postgres' 53 | replacement of `malloc`), how to use it and its consequences on 54 | performance. 55 | Tomas Vondra, 2014 56 | 57 | * [Postgresql hooks documentation](https://github.com/AmatanHead/psql-hooks) 58 | A github repository documenting all function hooks in PostgreSQL 59 | Begishev Nikita and Goncharov Vladimir, 2018 60 | 61 | * [Review of Patch Reviewing](https://www.postgresql.eu/events/pgconfeu2018/sessions/session/2066/slides/95/patch_review-present.pdf) 62 | An explanation of how to review a patch in postgres 63 | Stephen Frost, 2018 64 | 65 | * [Serverside Programming in C](http://hlinnaka.iki.fi/presentations/PGConf.eu-Serverside-Programming-in-C.pdf) 66 | A good intro to get started in hacking postgres, including memory management, 67 | string handling, error reporting, useful structures, etc. 68 | Heikki Linnakangas, 2018 69 | 70 | * [Writing Postgres extensions - the basics](http://big-elephants.com/2015-10/writing-postgres-extensions-part-i/) 71 | [Writing Postgres extensions - types and operators](http://big-elephants.com/2015-10/writing-postgres-extensions-part-ii/) 72 | [Writing Postgres extensions - debugging](http://big-elephants.com/2015-10/writing-postgres-extensions-part-iii/) 73 | [Writing Postgres extensions - testing](http://big-elephants.com/2015-11/writing-postgres-extensions-part-iv/) 74 | [Writing Postgres extensions - code organization and versioning](http://big-elephants.com/2015-11/writing-postgres-extensions-part-v/) 75 | A series of blog posts that explain in details how to code your own extensions 76 | Manuel Kniep and adjust GmbH, 2015 77 | 78 | ## Internals 79 | 80 | * [Access path selection in a relational database management system](https://s3.amazonaws.com/academia.edu.documents/12453180/selinger-etal-1979.pdf?AWSAccessKeyId=AKIAIWOWYYGZ2Y53UL3A&Expires=1524048486&Signature=2e%2Fpd9Wk57zalZ7lwQAixWYl%2FPg%3D&response-content-disposition=inline%3B%20filename%3DAccess_path_selection_in_a_relational_da.pdf) 81 | The original article describing the query optimizer dynamic algorithm for join 82 | order selection, originally implemented in System R but still used in many 83 | DBMSs, including PostgreSQL. 84 | Patricia Selinger et al., 1976 85 | 86 | * [All you need to know about sorting in Postgres](https://madusudanan.com/blog/all-you-need-to-know-about-sorting-in-postgres/) 87 | An overview of the sorting algorithms used in PostgreSQL and how PostgreSQL 88 | chooses which one to use. 89 | Madusudanan.B.N, 2016 90 | 91 | * [A look at how postgres executes a join](http://patshaughnessy.net/2015/11/24/a-look-at-how-postgres-executes-a-tiny-join) 92 | A detailed description of join execution. 93 | Pat Shaughnessy, 2015 94 | 95 | * [Backend flowchart](https://www.postgresql.org/developer/backend/) 96 | A chart describing the role of each component in the backend. Don't forget to 97 | also check the [full 98 | index](https://wiki.postgresql.org/wiki/Backend_flowchart) that is 99 | associated to it. 100 | PostgreSQL, 2012 101 | 102 | * [Buffer manager](http://www.interdb.jp/pg/pgsql08.html) 103 | A detailed description of the cache handling in PostgreSQL. 104 | Hironobu Suzuki, 2016 105 | 106 | * [Explaining `CREATE INDEX CONCURRENTLY`](http://blog.2ndquadrant.com/create-index-concurrently/) 107 | A blog post explaining in great detail how PostgreSQL builds an index without 108 | locking the table from updates. 109 | Pavan Deolasee, 2017 110 | 111 | * [Explaining the query optimizer](http://momjian.us/main/writings/pgsql/optimizer.pdf) 112 | A presentation introducing the query planner. 113 | Bruce Momjian, 2016 114 | 115 | * [Explicit locking](https://www.postgresql.org/docs/current/static/explicit-locking.html) 116 | The section in PostgreSQL docs that explains the various locks available and 117 | how they interact with each other. 118 | PostgreSQL, current 119 | 120 | * [HOT](https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/access/heap/README.HOT;hb=HEAD) 121 | The readme in the PostgreSQL source code that describes in great details how 122 | Heap-Only Tuples (HOT) work. 123 | PostgreSQL, 2012 124 | 125 | * [Index internals](https://www.pgcon.org/2016/schedule/attachments/434_Index-internals-PGCon2016.pdf) 126 | A presentation ([video 127 | available](https://www.youtube.com/watch?v=W6B8-srOsrs)) that describes how 128 | the different indexes in PostgreSQL store data. 129 | Heikki Linnakangas, 2016 130 | 131 | * [PostgreSQL internals through pictures](https://momjian.us/main/writings/pgsql/internalpics.pdf) 132 | A presentation doing a broad overview of PostgreSQL internals. 133 | Bruce Momjian, 2016 134 | 135 | * [PostgreSQL query optimization](http://jinchengli.me/post/postgres-query-opt/) 136 | A blog post introducing query evaluation plans and the algorithm to generate 137 | them. 138 | Jincheng Li, 2016 139 | 140 | * [Query execution techniques in PostgreSQL](http://www.neilconway.org/talks/executor.pdf) 141 | A presentation that describes how plan nodes are executed. 142 | Neil Conway, 2007 143 | 144 | ## SQL 145 | 146 | * [Explanation of jsonb introduced by PostgreSQL](http://stackoverflow.com/a/22910602/2451259) 147 | A stackoverflow answer that explains concisely the differences between hstore, 148 | json and jsonb formats. 149 | pozs, 2014 150 | 151 | * [PostgreSQL cheat sheet: string functions](http://postgresql-backup.com/postgresql-blog/wp-content/uploads/2016/06/PostgreSQL-Cheat-Sheet_-String-Functions.pdf) 152 | A cheat sheet for string operations in PostgreSQL. 153 | PostgreSQL Backup, 2016 154 | 155 | * [Postgres window magic](http://momjian.us/main/writings/pgsql/window.pdf) 156 | A presentation detailing the possibilities of window functions. 157 | Bruce Momjian, 2017 158 | 159 | * [SQL joins visualizer](http://sql-joins.leopard.in.ua/) 160 | Describe the data you want to get from a join using Venn diagrams, and the 161 | corresponding SQL join is generated. 162 | Alexey Vasiliev, 2016 163 | --------------------------------------------------------------------------------