X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 4281E9DCD75 for ; Sat, 21 Jan 2006 12:39:38 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 98835-03-8 for ; Sat, 21 Jan 2006 12:39:33 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id BE1379DCCE3 for ; Sat, 21 Jan 2006 12:39:16 -0400 (AST) Received: from smtpauth04.mail.atl.earthlink.net (smtpauth04.mail.atl.earthlink.net [209.86.89.64]) by svr4.postgresql.org (Postfix) with ESMTP id 685B75AF98C for ; Sat, 21 Jan 2006 16:12:21 +0000 (GMT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=C0oBqpb3BXJd0V5QrUk2oUOYAEn9t8P6d0m2E0VzrFZiWrBPYfSypl0G6ZVtuEsw; h=Received:Message-Id:X-Mailer:Date:To:From:Subject:Cc:In-Reply-To:References:Mime-Version:Content-Type:X-ELNK-Trace:X-Originating-IP; Received: from [70.22.189.241] (helo=ron-6d52adff2a6.earthlink.net) by smtpauth04.mail.atl.earthlink.net with asmtp (Exim 4.34) id 1F0LLL-0000UO-RJ; Sat, 21 Jan 2006 11:12:00 -0500 Message-Id: <7.0.1.0.2.20060121105907.03955090@earthlink.net> X-Mailer: QUALCOMM Windows Eudora Version 7.0.1.0 Date: Sat, 21 Jan 2006 11:11:53 -0500 To: Oleg Bartunov , pgsql-performance@postgresql.org From: Ron Subject: Re: [GENERAL] Creation of tsearch2 index is very Cc: Tom Lane In-Reply-To: References: <26153.1137784469@sss.pgh.pa.us> <20060120201036.GE31908@svana.org> <26583.1137788505@sss.pgh.pa.us> <20060120205132.GF31908@svana.org> <26958.1137791955@sss.pgh.pa.us> <20060120213754.GG31908@svana.org> <7.0.1.0.2.20060120174141.039b03e8@earthlink.net> <6111.1137797436@sss.pgh.pa.us> <20060120225751.GA27230@uio.no> <6532.1137801157@sss.pgh.pa.us> <20060121000519.GA29755@uio.no> <6743.1137802990@sss.pgh.pa.us> <7.0.1.0.2.20060121064930.03aba810@earthlink.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-ELNK-Trace: acd68a6551193be5d780f4a490ca69563f9fea00a6dd62bcc6e1c1df5990107b178217cceb90f5b4350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 70.22.189.241 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.434 required=5 tests=[AWL=-0.045, DNS_FROM_RFC_ABUSE=0.479] X-Spam-Score: 0.434 X-Spam-Level: X-Archive-Number: 200601/393 X-Sequence-Number: 16871 Perhaps a different approach to this problem is called for: _Managing Gigabytes: Compressing and Indexing Documents and Images_ 2ed Witten, Moffat, Bell ISBN 1-55860-570-3 This is a VERY good book on the subject. I'd also suggest looking at the publicly available work on indexing and searching for search engines like Inktomi (sp?) and Google. Ron At 08:34 AM 1/21/2006, Oleg Bartunov wrote: >On Sat, 21 Jan 2006, Ron wrote: > >>At 07:23 PM 1/20/2006, Tom Lane wrote: >>>"Steinar H. Gunderson" writes: >>> > On Fri, Jan 20, 2006 at 06:52:37PM -0500, Tom Lane wrote: >>> >> It's also worth considering that the entire approach is a heuristic, >>> >> really --- getting the furthest-apart pair of seeds doesn't guarantee >>> >> an optimal split as far as I can see. Maybe there's some totally >>> >> different way to do it. >>> > For those of us who don't know what tsearch2/gist is trying to accomplish >>> > here, could you provide some pointers? :-) >>>Well, we're trying to split an index page that's gotten full into >>>two index pages, preferably with approximately equal numbers of items in >>>each new page (this isn't a hard requirement though). >> >>Maybe we are over thinking this. What happens if we do the obvious >>and just make a new page and move the "last" n/2 items on the full >>page to the new page? >> >>Various forms of "move the last n/2 items" can be tested here: >>0= just split the table in half. Sometimes KISS works. O(1). >>1= the one's with the highest (or lowest) "x" value. >>2= the one's with the highest sum of coordinates (x+y+...= values >>in the top/bottom n/2 of entries). >>3= split the table so that each table has entries whose size_waste >>values add up to approximately the same value. >>4= I'm sure there are others. >>1-5 can be done in O(n) time w/o auxiliary data. They can be done >>in O(1) if we've kept track of the appropriate metric as we've >>built the current page. >> >> >>>I think the true figure of merit for a split is how often will >>>subsequent searches have to descend into *both* of the resulting >>>pages as opposed to just one >>>--- the less often that is true, the better. I'm not very clear >>>on what tsearch2 is doing with these bitmaps, but it looks like an >>>upper page's downlink has the union (bitwise OR) of the one-bits >>>in the values on the lower page, and you have to visit the lower >>>page if this union has a nonempty intersection with the set you >>>are looking for. If that's correct, what you really want is to >>>divide the values so that the unions of the two sets have minimal >>>overlap ... which seems to me to have little to do with what the >>>code does at present. >>I'm not sure what "upper page" and "lower page" mean here? >> >> >>>Teodor, Oleg, can you clarify what's needed here? >>Ditto. Guys what is the real motivation and purpose for this code? > >we want not just split the page by two very distinct parts, but to keep >resulted signatures which is ORed signature of all signatures in the page >as much 'sparse' as can. some information available here >http://www.sai.msu.su/~megera/oddmuse/index.cgi/Tsearch_V2_internals > >Unfortunately, we're rather busy right now and couldn't be very useful.