Re: [PERFORM] Insert performance and multi-column index order

2009-06-30 Thread Bob Lunney
ame reason, but forgot to apply the lesson to PostgreSQL. BTW, this is PG 8.2.1 and 8.3.7 running on SLES 10.3, although I don't think it matters. Thanks for the help, Greg and Tom! --- On Sat, 6/27/09, Greg Smith wrote: > From: Greg Smith > Subject: Re: [PERFORM] Insert performa

Re: [PERFORM] Insert performance and multi-column index order

2009-06-26 Thread Greg Smith
On Fri, 26 Jun 2009, bob_lun...@yahoo.com wrote: The original unique index was in the order (timestamptz, varchar, text, text) and most queries against it were slow.  I changed the index order to (varchar, text, timestamptz, text) and queries now fly, but loading data (via copy from stdin) in

Re: [PERFORM] Insert performance and multi-column index order

2009-06-26 Thread Tom Lane
bob_lun...@yahoo.com writes: > Why would changing the column order on a unique index cause data loading or > index servicing to slow down? Page splits in the b-tree, maybe? Yeah, perhaps. Tell us about the data distributions in the columns? Is there any ordering to the keys that're being insert

[PERFORM] Insert performance and multi-column index order

2009-06-26 Thread bob_lunney
I have a partitioned table with a multi-column unique index.  The table is partitioned on a timestamp with time zone column.  (I realize this has nothing to do with the unique index.)  The original unique index was in the order (timestamptz, varchar, text, text) and most queries against it were