Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id E40D464FE03 for ; Wed, 26 Nov 2008 13:40:16 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 07670-01 for ; Wed, 26 Nov 2008 13:40:13 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from www.postnewspapers.com.au (www.postnewspapers.com.au [202.61.230.242]) by mail.postgresql.org (Postfix) with ESMTP id 406A764FD32 for ; Wed, 26 Nov 2008 13:40:13 -0400 (AST) Received: from mail.postnewspapers.com.au (202-89-185-120.static.dsl.amnet.net.au [202.89.185.120]) by www.postnewspapers.com.au (Postfix) with ESMTP id DB95A5C24E; Thu, 27 Nov 2008 02:40:08 +0900 (WST) Received: from localhost (access [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id BE5551E0435; Thu, 27 Nov 2008 02:40:08 +0900 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (access.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id phARHADQGzRi; Thu, 27 Nov 2008 02:40:08 +0900 (WST) Received: from [192.168.44.80] (203-59-94-220.perm.iinet.net.au [203.59.94.220]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTP id 30E961E0434; Thu, 27 Nov 2008 02:40:08 +0900 (WST) Message-ID: <492D89F7.6040700@postnewspapers.com.au> Date: Thu, 27 Nov 2008 02:40:07 +0900 From: Craig Ringer User-Agent: Thunderbird 2.0.0.17 (X11/20080925) MIME-Version: 1.0 To: Chavdar Kopoev Cc: pgsql-performance Subject: Re: many to many performance References: <200811261738027964123@kopoev.com> In-Reply-To: <200811261738027964123@kopoev.com> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200811/261 X-Sequence-Number: 31992 Chavdar Kopoev wrote: > I want to use as a data storage postgresql. Tried several data structures, testing btree, gin, gist indecies over them, but best achieved performance for a 10 times smaller dataset (10k cat ids, 100k doc ids, 1m relations) is slower more than 5 times. Can you post your queries and table definitions so people trying to help you know what you did / tried to do? A downloadable self contained example might also be useful. Please also post the output of `EXPLAIN' on your queries, eg: EXPLAIN SELECT blah, ... FROM blah; > I read about postgresql bitmap indecies and "data lookup" when scanning indecies to get a value for current transaction. Downloaded latest v8.4 snapshot, compiled it, but as I see there is no bitmap index in it. Maybe if I download HEAD revision I will find them there, dont know. Bitmap index scans are an internal function that's used to combine two indexes on the fly during a query (or at least use both of them in one table scan). You don't make a bitmap index, you just make two ordinary btree indexes and let Pg take care of this for you. If you query on the columns of interest a lot, you might want to use a multi-column index instead. -- Craig Ringer