.project
author Inigo Sanchez <inigo.sanchez@openbravo.com>
Wed, 11 Mar 2015 10:42:05 +0100
changeset 26161 3610bd347abc
parent 21783 e8f73de22697
child 30869 691f92a3ac85
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.
carlos@0
     1
<?xml version="1.0" encoding="UTF-8"?>
carlos@0
     2
<projectDescription>
carlos@0
     3
	<name>openbravo</name>
carlos@0
     4
	<comment></comment>
carlos@0
     5
	<projects>
carlos@0
     6
	</projects>
carlos@0
     7
	<buildSpec>
carlos@0
     8
		<buildCommand>
carlos@0
     9
			<name>org.eclipse.jdt.core.javabuilder</name>
carlos@0
    10
			<arguments>
carlos@0
    11
			</arguments>
carlos@0
    12
		</buildCommand>
carlos@0
    13
		<buildCommand>
ivan@1738
    14
			<name>org.openarchitectureware.base.oawBuilder</name>
carlos@0
    15
			<arguments>
carlos@0
    16
			</arguments>
carlos@0
    17
		</buildCommand>
carlos@0
    18
	</buildSpec>
carlos@0
    19
	<natures>
carlos@0
    20
		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
carlos@0
    21
		<nature>org.eclipse.jdt.core.javanature</nature>
carlos@0
    22
		<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
carlos@0
    23
		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
ivan@1738
    24
		<nature>org.openarchitectureware.base.oawNature</nature>
carlos@0
    25
	</natures>
carlos@0
    26
</projectDescription>