Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 420DC1337B49 for ; Sun, 31 Oct 2010 17:42:36 -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 87211-03 for ; Sun, 31 Oct 2010 20:42:30 +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 9A3E81337990 for ; Sun, 31 Oct 2010 17:42:28 -0300 (ADT) Received: by pvb32 with SMTP id 32so373417pvb.19 for ; Sun, 31 Oct 2010 13:42:28 -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=+HTHlY4U0RkWdWcIdKPJqhc4xAkGZy2JL3oqaWvw3fM=; b=e8A0J2zu80IO+A5svk3Mr0bAEtlV2QaazQ0/kgLKyDGbWnQKEVJPkl+voHz9nfZh91 ItL7sZ8EqjrN4pl+QHp/Oz2GHGV4pinURHkbRlT4j0GhVpHkE+2mrKT5FKQ/tyjaedqp Lo8nkRsm6DKogyaPMuX8lYLWfeM0DUgB3wBmg= 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=nU3UIWqLKZ30jsC5VX2Pu7mwFal8DWbFHZIfMDLLBsYaaceZNxy43QkM8eqnQO8fc0 q5NHST15MVCT0c+79sJHcxtUbc54vEWT4oYULUappTn+50hrRG4DnWBiMtk8l0hc+pbV 7BPVhUtq0VDRZwnVT466kDtxB6FtILyfMqy3I= Received: by 10.142.13.2 with SMTP id 2mr1194405wfm.370.1288557748162; Sun, 31 Oct 2010 13:42:28 -0700 (PDT) Received: from [192.168.0.2] (rsargent.dsl.xmission.com [199.104.125.126]) by mx.google.com with ESMTPS id w15sm4511986wfd.9.2010.10.31.13.42.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 31 Oct 2010 13:42:27 -0700 (PDT) Message-ID: <4CCDD4B0.7030605@gmail.com> Date: Sun, 31 Oct 2010 14:42:24 -0600 From: Rob Sargent User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: =?windows-1252?Q?Viktor_Bojovic=27?= CC: James Cloos , pgsql-sql@postgresql.org Subject: Re: large xml database References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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/83 X-Sequence-Number: 34734 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)?