Re: Insert Performance - Mailing list pgsql-hackers

From Zeugswetter Andreas SB SD
Subject Re: Insert Performance
Date
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA4887A39@m0114.s-mxs.net
Whole thread Raw
In response to Insert Performance  ("Michael Paesold" <mpaesold@gmx.at>)
List pgsql-hackers
> What could you recommend? Locking the table and selecting
> max(invoice_id) wouldn't really be much faster, with max(invoice_id)
> not using an index...

select invoice_id from table order by invoice_id desc limit 1;

should get you the maximum fast if you have a unique index on invoice_id.

Andreas


pgsql-hackers by date:

Previous
From: "Zeugswetter Andreas SB SD"
Date:
Subject: Re: AIX compilation problems (was Re: Proposal ...)
Next
From: Jan Wieck
Date:
Subject: Re: PGXLOG variable worthwhile?