Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id D46551337C74 for ; Sat, 30 Apr 2011 15:19:12 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 55147-01-5 for ; Sat, 30 Apr 2011 18:19:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.216.181]) by mail.postgresql.org (Postfix) with ESMTP id 982521337C01 for ; Sat, 30 Apr 2011 15:16:37 -0300 (ADT) Received: by qyg14 with SMTP id 14so2440895qyg.19 for ; Sat, 30 Apr 2011 11:16:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:references:from:in-reply-to:mime-version:date :message-id:subject:to:cc:content-type; bh=lCSrYm9LA/RC/9Kik72peHzz9KB73a1FGtwXO+wZEK0=; b=RA9EIivAV7O5BRDEN/G27pzZIyMKN5bPHIqv/cjWoHcmHmHyp5BXI+2/eRsJhRRAbJ XC2NTHy9G85ERVt8AhcEzDjNr7BWOZ1990kobGiuQkqbQtKhDFnQDnhk1vdCuKBPzo7I Pu/VVY2km1+Q1qxtmczLknLst7AZgf06ksDEU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:from:in-reply-to:mime-version:date:message-id:subject:to :cc:content-type; b=PADpGq5Ot7B27A1v4ocw5SEopEFPx0NffeKylFu34E3ivRWm6ikRrm8emReFDv8fHH brcAE5aGZ22bTZtvv02aBCfHfzlQ4zrbVkSqjPOF9zInpNPzFodnnYYzTy93JD5wgxgx L9ONGLWBjvafr0YHZ1AtRdhqZE/BatxKWtnes= Received: by 10.229.87.143 with SMTP id w15mr4773443qcl.170.1304187397262; Sat, 30 Apr 2011 11:16:37 -0700 (PDT) References: <4DBC004C020000250003D099@gw.wicourts.gov> <4881277622113933088@unknownmsgid> From: Joel Reymont In-Reply-To: Mime-Version: 1.0 (iPhone Mail 8H7) Date: Sat, 30 Apr 2011 19:14:31 +0100 Message-ID: <7582830307139292886@unknownmsgid> Subject: Re: stored proc and inserting hundreds of thousands of rows To: Pierre C Cc: "pgsql-performance@postgresql.org" Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.345 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=1.553, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201104/439 X-Sequence-Number: 43501 I'm calculating distance between probability vectors, e.g. topics that a document belongs to and the topics of an ad. The distance function is already a C function. Topics are float8[150]. Distance is calculated against all documents in the database so it's arable scan. Sent from my comfortable recliner On 30/04/2011, at 19:04, Pierre C wrote: > > If you want to search by geographical coordinates, you could use a gist index which can optimize that sort of things (like retrieving all rows which fit in a box).