Multi-column index vs index on individual columns

2020-12-26 Thread Shantanu Shekhar
Hi, I was going through Postgres documentation on multi-column indexes and came across the recommendation at the bottom states: "Multicolumn indexes should be used sparingly. In most situations, an index on a single column is sufficient and saves space and time".  In my experience typical webapp

Stats for indexes on expressions

2020-12-24 Thread Shantanu Shekhar
Hello, I am trying to understand how the cost for a query involving indexes on expressions is calculated. How is the statistics on the expression maintained? For example Postgres documentation on 'Indexes on Expressions' mentions the following example: CREATE INDEX people_names ON people ((first

Range search on primary key does not use index scan

2020-12-23 Thread Shantanu Shekhar
I am trying to understand how Postgres uses index and ran into a surprising behavior if someone can help me with. I have a table like so: CREATE TABLE testschema.employees (        employee_id integer not null, first_name  varchar(1000) not null, last_name   varchar(1000) not null, date_of_birth

Re: Sequence generating negative numbers

2020-08-20 Thread Shantanu Shekhar
Adrian, The sequence is not set as a default on PK. The sequence is exclusively being used by the ORM.  Thanks, Shantanu On Wednesday, August 19, 2020, 06:28:53 PM EDT, Adrian Klaver wrote: On 8/19/20 3:24 PM, Shantanu Shekhar wrote: Please reply to list also. Ccing list. > Tha

Sequence generating negative numbers

2020-08-19 Thread Shantanu Shekhar
Team, I have a sequence definition in Postgres 9.6.11 like so: CREATE SEQUENCE IF NOT EXISTS org.my_seq  INCREMENT 1  MINVALUE 1  NO MAXVALUE  START 1  CACHE 20; This sequence is used by a Java ORM framework to generate primary keys for one of our tables. The initial numbers generated by this seq

Postgres automatic minor version upgrade

2020-08-12 Thread Shantanu Shekhar
Hello, We are using Postgres 11.6 through AWS relational database service. As part of its RDS service AWS offers automatic minor version upgrade. If we turn this setting on the minor versions will get upgraded without us even knowing about it. We are in a security sensitive vertical so we would

JDBC driver version for a given Postgres version

2020-07-14 Thread Shantanu Shekhar
We are upgrading our Postgres instance from 9.6.11 to 10.11. Then as part of a second upgrade we will go from 10.11 to 11.6. Currently (with 9.6.11) we are using the 42.2.1 JDBC driver. I am trying to figure out the impact our database upgrade will have on the JDBC driver version but I cannot fi