Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 97C3A476301 for ; Sat, 3 Aug 2002 06:09:44 -0400 (EDT) Received: from mail.iinet.net.au (symphony-03.iinet.net.au [203.59.3.35]) by postgresql.org (Postfix) with SMTP id 14DD6475812 for ; Sat, 3 Aug 2002 06:09:43 -0400 (EDT) Received: (qmail 20903 invoked by uid 666); 3 Aug 2002 10:09:39 -0000 Received: from unknown (HELO SOL) (203.59.159.168) by mail.iinet.net.au with SMTP; 3 Aug 2002 10:09:39 -0000 Message-ID: <009401c23ad5$eb6512f0$0200a8c0@SOL> From: "Christopher Kings-Lynne" To: =?iso-8859-1?Q?C=E9dric_Dufour?= , References: Subject: Re: Random resultset retrieving -> performance bottleneck Date: Sat, 3 Aug 2002 18:09:55 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/55 X-Sequence-Number: 8901 > I'm running into a performance problem when considering the following > scenario: I have a fairly large table (1mio rows) related to other smaller > tables (between 100 and 10000 rows) and would like to retrieve the joined > data (through a view) in random order. In order to do so, the main table > contains a 'Random' field (which is updated on a regular basis, in order to > re-randomize the data set), on which an index is created: Have you tried adding ORDER BY RANDOM() onto your select query? Chris