Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id C52F21337B4A for ; Sun, 31 Oct 2010 18:26:12 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 36824-06 for ; Sun, 31 Oct 2010 21:26:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pv0-f174.google.com (mail-pv0-f174.google.com [74.125.83.174]) by mail.postgresql.org (Postfix) with ESMTP id 28FBE1336473 for ; Sun, 31 Oct 2010 18:26:04 -0300 (ADT) Received: by pvb32 with SMTP id 32so376890pvb.19 for ; Sun, 31 Oct 2010 14:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=t/tRuYvhdFEB7zDPa+OTOZNCDpAro6ty/w2DuWkcev4=; b=VSNGcWT2ecfCDfDzb0RPS9UiOeUt9MyfvPwOp1tDOVumEYi39Gwnf+V0pPnhJyVeci /XTsTSSWJUM/MLnvY9SJEMpGhW80Gvkjd8Zisk7YjPSlSFrjvicRJMXKGX6l0mHnPjH9 potjjYe8luLZHN6JlKIuYFN3B1/Rhrx+ToTpw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=d+jgsxTbGYF/ZtkMgBxdy5Dyxx2qkQhyVBmg7EnoBeZyWTBd7jsjygKl7Ja/AYQAyg +MPJCuNJuYRlsskGGjvwVpPHXtEgcoH7kiDFi8VomR1c0p6TScfgg6tm8xae0oj8gO5A +8rPnujZZbx9Peco572EhPk54HTb0q9omd3Sk= Received: by 10.142.49.12 with SMTP id w12mr3521388wfw.160.1288560364877; Sun, 31 Oct 2010 14:26:04 -0700 (PDT) Received: from [192.168.0.2] (rsargent.dsl.xmission.com [199.104.125.126]) by mx.google.com with ESMTPS id x18sm7494212wfa.11.2010.10.31.14.26.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 31 Oct 2010 14:26:04 -0700 (PDT) Message-ID: <4CCDDEE9.9010803@gmail.com> Date: Sun, 31 Oct 2010 15:26:01 -0600 From: Rob Sargent User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: =?UTF-8?B?VmlrdG9yIEJvam92acSH?= CC: pgsql-sql@postgresql.org Subject: Re: large xml database References: <4CCDD4B0.7030605@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201010/85 X-Sequence-Number: 34736 Viktor Bojović wrote: > > > On Sun, Oct 31, 2010 at 9:42 PM, Rob Sargent > wrote: > > > > > Viktor Bojovic' wrote: > > > > On Sun, Oct 31, 2010 at 2:26 AM, James Cloos > > >> wrote: > > >>>>> "VB" == Viktor Bojovic' > > >> writes: > > VB> i have very big XML documment which is larger than 50GB and > want to > VB> import it into databse, and transform it to relational > schema. > > Were I doing such a conversion, I'd use perl to convert the > xml into > something which COPY can grok. Any other language, script > or compiled, > would work just as well. The goal is to avoid having to > slurp the > whole > xml structure into memory. > > -JimC > -- > James Cloos > >> > > OpenPGP: 1024D/ED7DAEA6 > > > The insertion into dabase is not very big problem. > I insert it as XML docs, or as varchar lines or as XML docs in > varchar format. Usually i use transaction and commit after > block of 1000 inserts and it goes very fast. so insertion is > over after few hours. > But the problem occurs when i want to transform it inside > database from XML(varchar or XML format) into tables by parsing. > That processing takes too much time in database no matter if > it is stored as varchar lines, varchar nodes or XML data type. > > -- > --------------------------------------- > Viktor Bojovic' > > --------------------------------------- > Wherever I go, Murphy goes with me > > > Are you saying you first load the xml into the database, then > parse that xml into instance of objects (rows in tables)? > > > Yes. That way takes less ram then using twig or simple xml, so I tried > using postgre xml functions or regexes. > > > > -- > --------------------------------------- > Viktor Bojović > --------------------------------------- > Wherever I go, Murphy goes with me Is the entire load a set of "entry" elements as your example contains? This I believe would parse nicely into a tidy but non-trivial schema directly without the "middle-man" of having xml in db (unless of course you prefer xpath to sql ;) ) The single most significant caveat I would have for you is Beware: Biologists involved. Inconsistency (at least overloaded concepts) almost assured :). EMBL too is suspect imho, but I've been out of that arena for a while.