summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-14 06:36:57 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-14 06:36:57 +0000
commit6bd41e8f6931366c0967e0846b4f2630761bc85e (patch)
treeb2875843e744ffe2cebf0f6fc28228ca066c1d14
parent7916dfcc89297f7799299ecc5a77fdac702bdf17 (diff)
Another performance patch
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1184 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-xLedgerSMB/Form.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index 8cc59544..f15ee00a 100755
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -1490,6 +1490,7 @@ sub db_init {
$self->{dbh}->do( $date_query{ $myconfig->{dateformat} } );
$self->{db_dateformat} = $myconfig->{dateformat}; #shim
+ #$self->{dbh}->do('set log_statement to \'all\'');
my $query = "SELECT t.extends,
coalesce (t.table_name, 'custom_' || extends)
@@ -2159,8 +2160,10 @@ sub all_years {
# get years
my $query = qq|
- SELECT (SELECT MIN(transdate) FROM acc_trans),
- (SELECT MAX(transdate) FROM acc_trans)|;
+ SELECT (SELECT transdate FROM acc_trans ORDER BY transdate asc
+ LIMIT 1),
+ (SELECT transdate FROM acc_trans ORDER BY transdate desc
+ LIMIT 1)|;
my ( $startdate, $enddate ) = $dbh->selectrow_array($query);