Infrastructure at your Service

Category Archives: Postgres

Franck Pachot

Postgres vs. Oracle access paths IV – Order By and Index

By | Oracle, Postgres | No Comments

I realize that I’m talking about indexes in Oracle and Postgres, and didn’t mention yet the best website you can find about indexes, with concepts and examples for all RDBMS: http://use-the-index-luke.com. You will probably learn a lot about SQL design. Now let’s continue on execution plans with indexes. As we have seen two posts ago, an index can be used even with a 100% selectivity (all rows), when we don’t filter any rows. Oracle has…

 
Read More
Franck Pachot

Postgres vs. Oracle access paths II – IndexOnlyScan

By | Oracle, Postgres | No Comments

In the previous post I’ve explained a sequential scan by accident: my query needed only one column which was indexed, and I expected to read the index rather than the table. And I had to hint the Oracle example to get the same because the Oracle optimizer chooses the index scan over the table scan in that case. Here is where I learned a big difference between Postgres and Oracle. They both use MVCC to…

 
Read More
Franck Pachot

Postgres vs. Oracle access paths I – Seq Scan

By | Oracle, Postgres | 5 Comments

Here is the first test I’ve done for my Postgres vs. Oracle access paths series and the first query did a sequential scan. It illustrates the first constant you find in the documentation for the query planner: seq_page_cost (floating point) Sets the planner’s estimate of the cost of a disk page fetch that is part of a series of sequential fetches. The default is 1.0.  

 
Read More
Franck Pachot

Postgres unique constraint

By | Postgres | No Comments

I’ll start a series on Postgres vs. Oracle access paths because I know Oracle and I learn Postgres. While preparing it, I came upon some surprises because I’m so used to Oracle that I take some behavior as granted for any SQL databases. I recently posted a tweet about one of them, comparing latest Postgres version to earliest Oracle version I have on my laptop. The goal of the tweet was exactly what I said…

 
Read More
Franck Pachot

Postgres vs. Oracle access paths – intro

By | Oracle, Postgres | 2 Comments

This is the start of a series on PostgreSQL execution plans, access path, join methods, hints and execution statistics. The approach will compare Postgres and Oracle. It is not a comparison to see which one is better, but rather to see what is similar and where the approaches diverge. I have a long experience of reading Oracle execution plans and no experience at all on Postgres. This is my way to learn and share what…

 
Read More
Franck Pachot

PostgreSQL on Cygwin

By | Postgres | No Comments

I run my laptop with Windows 10 for office programs, and VirtualBox machines with Linux for the big stuff (Oracle databases). I have also Cygwin installed on Windows for GNU programs. I wanted to quickly install PosgreSQL and rather than installing it in a Linux VM, or as a Windows program, I installed the Cygwin version of it. Here is how.  

 
Read More