postgresql bigserial or sequence using jpa I'm a java developer working with jpa, before to define the indexes in my entities i would like to known  which one is faster o better to use?.
bigserial is just shorthand for creating a sequence. So if you include the time it takes to type, bigserial has better "performance" :)

CREATE TABLE tablename (
    colname BIGSERIAL
);


Equals

CREATE SEQUENCE tablename_colname_seq;

CREATE TABLE tablename (
    colname biginteger DEFAULT nextval('tablename_colname_seq') NOT NULL
);


Also, if you these are your primary keys, then they are already indexed, so you don't need to index them (foreign key columns aren't indexed automatically though, FYI).

For JPA, you should use @GeneratedValue(strategy=GenerationType.IDENTITY) for PostgreSQL serial/bigserial columns.