Return-Path: X-Original-To: apmail-jackrabbit-dev-archive@www.apache.org Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 39E5CFF0E for ; Thu, 21 Mar 2013 09:12:31 +0000 (UTC) Received: (qmail 97973 invoked by uid 500); 21 Mar 2013 09:11:06 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 97287 invoked by uid 500); 21 Mar 2013 09:10:56 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 92597 invoked by uid 99); 21 Mar 2013 09:07:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Mar 2013 09:07:15 +0000 Date: Thu, 21 Mar 2013 09:07:15 +0000 (UTC) From: "Marcel Reutegger (JIRA)" To: dev@jackrabbit.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (JCR-3537) Large number of SQL queries when adding nodes with version history MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/JCR-3537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13608774#comment-13608774 ] Marcel Reutegger commented on JCR-3537: --------------------------------------- The versioning behavior is defined by the node type. E.g. see the definition for nt:folder: http://wiki.apache.org/jackrabbit/nt%3Afolder It says to create a version the child nodes when the parent is versioned. Maybe this is what happens in your case and is therefore expected? > Large number of SQL queries when adding nodes with version history > ------------------------------------------------------------------ > > Key: JCR-3537 > URL: https://issues.apache.org/jira/browse/JCR-3537 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: versioning > Affects Versions: 2.5 > Environment: Windows 2008, tomcat application server, SQL Server 2008 database server > Reporter: Todd Pagni > Labels: newbie, patch > Attachments: jackrabbit-core-2.5.0-version-history.patch > > > We are adding a large number of documents to a jackrabbit 2.5 database repository. We are using the bundle.MSSqlPersistenceManager and we are seeing a large number of SQL queries (300+) when adding a single folder, file, and file content. This appears to create a significant performance bottleneck when adding documents when the repository size is over 300k documents/nodes. The repository structure is a hierarchy with less than 1000k child nodes per parent. The following is an example structure of the repo with the (New child folder) representing the new content being added. > -- Root node > -- Parent node > --New child folder (mix:versionable,mix:lockable) > --new file (mix:versionable,mix:lockable) > --new document content > --Existing Child Folder > -- Parent node > The vast majority of the 200-300+ queries that execute when adding a node look like the following: > exec sp_execute 2,0x5740D9A36F2E4032BFF0BA652D89FFB8 > exec sp_execute 2,0xBBFE059BF7E44947A8B0858F3CE33DB8 > exec sp_execute 2,0xC2AD22DBE1DB43A083BCA1B2C94E07CC > The majority of the queries that are executed appear to be related to versioning. When a node is added the version history for the node stored/saved, the parent node is saved, which ultimately cascades and saves all children of the parent, so adding a child node saves the parent and all other children. > We have created a patch for jackrabbit-core 2.5.0 to prevent the cascade to store all other child nodes when saving/storing the version history of a new node. This cuts the number of queries that are executed in half. Does anyone see a problem with this technique? All unit tests are still passing. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira