src-test/log4j.lcf
author Inigo Sanchez <inigo.sanchez@openbravo.com>
Wed, 11 Mar 2015 10:42:05 +0100
changeset 26161 3610bd347abc
parent 24247 a0955a83d426
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.
asier@24247
     1
#*************************************************************************
asier@24247
     2
#* The contents of this file are subject to the Openbravo  Public  License
asier@24247
     3
#* Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
asier@24247
     4
#* Version 1.1  with a permitted attribution clause; you may not  use this
asier@24247
     5
#* file except in compliance with the License. You  may  obtain  a copy of
asier@24247
     6
#* the License at http://www.openbravo.com/legal/license.html 
asier@24247
     7
#* Software distributed under the License  is  distributed  on  an "AS IS"
asier@24247
     8
#* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
asier@24247
     9
#* License for the specific  language  governing  rights  and  limitations
asier@24247
    10
#* under the License. 
asier@24247
    11
#* The Original Code is Openbravo ERP. 
asier@24247
    12
#* The Initial Developer of the Original Code is Openbravo SLU 
asier@24247
    13
#* All portions are Copyright (C) 2014 Openbravo SLU 
asier@24247
    14
#* All Rights Reserved. 
asier@24247
    15
#* Contributor(s):  ______________________________________.
asier@24247
    16
#************************************************************************
asier@24247
    17
asier@24247
    18
# File is used by ApplyModule and other ant tasks
asier@24247
    19
asier@24247
    20
log4j.rootCategory=INFO, A1, O2
asier@24247
    21
asier@24247
    22
# Additional Appender used for Improved Upgrade Process
asier@24247
    23
log4j.appender.O2=org.openbravo.utils.OBRebuildAppender
asier@24247
    24
asier@24247
    25
# A1 is set to be a ConsoleAppender. 
asier@24247
    26
log4j.appender.A1=org.apache.log4j.ConsoleAppender
asier@24247
    27
  
asier@24247
    28
# A1 uses PatternLayout.
asier@24247
    29
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
asier@24247
    30
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c - %m%n
asier@24247
    31
asier@24247
    32
log4j.category.org.openbravo.data.Sqlc=INFO
asier@24247
    33
log4j.category.org.openbravo.translate.Translate=INFO
asier@24247
    34
log4j.category.org.openbravo.wad=INFO
asier@24247
    35
#log4j.category.org.openbravo.translate=INFO
asier@24247
    36
asier@24247
    37
log4j.category.org=WARN
asier@24247
    38
asier@24247
    39
#****************************************************
asier@24247
    40
#Part added for hibernate
asier@24247
    41
#****************************************************
asier@24247
    42
log4j.logger.org.hibernate=error
asier@24247
    43
asier@24247
    44
### log HQL query parser activity 
asier@24247
    45
#log4j.logger.org.hibernate.hql.ast.AST=error
asier@24247
    46
asier@24247
    47
### log just the SQL
asier@24247
    48
log4j.logger.org.hibernate.SQL=error
asier@24247
    49
asier@24247
    50
### log JDBC bind parameters ###
asier@24247
    51
log4j.logger.org.hibernate.type=error
asier@24247
    52
asier@24247
    53
### log schema export/update ###
asier@24247
    54
log4j.logger.org.hibernate.tool.hbm2ddl=error
asier@24247
    55
asier@24247
    56
### log HQL parse trees
asier@24247
    57
log4j.logger.org.hibernate.hql=error
asier@24247
    58
asier@24247
    59
### log cache activity ###
asier@24247
    60
log4j.logger.org.hibernate.cache=error
asier@24247
    61
asier@24247
    62
### log transaction activity
asier@24247
    63
log4j.logger.org.hibernate.transaction=error
asier@24247
    64
asier@24247
    65
### log JDBC resource acquisition
asier@24247
    66
log4j.logger.org.hibernate.jdbc=error
asier@24247
    67