update.database.launch
author Inigo Sanchez <inigo.sanchez@openbravo.com>
Wed, 11 Mar 2015 10:42:05 +0100
changeset 26161 3610bd347abc
parent 1550 f84e3b62bd71
permissions -rw-r--r--
Fixed issue 28968: When installing a module the rebuild takes long to start.

The problem was that when installing a module the rebuild takes long to start.
This happened on environments with a lot of rows (Tested with 260.000 rows) on
the ad_session table.The result was this:

explain UPDATE AD_SESSION SET SESSION_ACTIVE='N' WHERE CREATEDBY<>'100'
Update on ad_session (cost=0.00..21546.15 rows=266303 width=147)

-> Seq Scan on ad_session (cost=0.00..21546.15 rows=266303 width=147)
Filter: ((createdby)::text <> '100'::text)
Approx time execution: 30000 ms

The new SQL Query to update is this:

explain UPDATE AD_SESSION SET SESSION_ACTIVE='N' WHERE CREATEDBY<>'100' and SESSION_ACTIVE='Y'
Update on ad_session (cost=0.42..4.44 rows=1 width=147)

-> Index Scan using ad_session_active_idx on ad_session (cost=0.42..4.44 rows=1 width=147)
Index Cond: (session_active = 'Y'::bpchar)
Filter: ((createdby)::text <> '100'::text)
Approx time execution: 30 ms

Adding the new condition "SESSION_ACTIVE = 'Y'" has been achieved to improve the performance.
<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.ui.externaltools.launchGroup"/>
</listAttribute>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/openbravo}"/>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<stringAttribute key="org.eclipse.ant.ui.ATTR_BUILD_SCOPE" value="${none}"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_TARGETS" value="update.database,"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="openbravo"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/openbravo/build.xml"/>
</listAttribute>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/openbravo/build.xml}"/>
</launchConfiguration>