Re: Insert Performance

From: "Zeugswetter Andreas SB SD" <ZeugswetterA(at)spardat(dot)at>
To: "Michael Paesold" <mpaesold(at)gmx(dot)at>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Insert Performance
Date: 2002-09-26 13:48:42
Message-ID: 46C15C39FEB2C44BA555E356FBCD6FA4887A39@m0114.s-mxs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2002-09-26 13:55:47 Re: PGXLOG variable worthwhile?
Previous Message Andriy Tkachuk 2002-09-26 12:11:55 query speed depends on lifetime of frozen db?