Skip to content

Commit

Permalink
Fixes #8001: create an index for detection of eventlog version
Browse files Browse the repository at this point in the history
  • Loading branch information
ncharles committed Feb 29, 2016
1 parent 5cc1c13 commit 7d6817b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
*************************************************************************************
* Copyright 2016 Normation SAS
*************************************************************************************
*
* This file is part of Rudder.
*
* Rudder is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* In accordance with the terms of section 7 (7. Additional Terms.) of
* the GNU General Public License version 3, the copyright holders add
* the following Additional permissions:
* Notwithstanding to the terms of section 5 (5. Conveying Modified Source
* Versions) and 6 (6. Conveying Non-Source Forms.) of the GNU General
* Public License version 3, when you create a Related Module, this
* Related Module is not considered as a part of the work and may be
* distributed under the license agreement of your choice.
* A "Related Module" means a set of sources files including their
* documentation that, without modification of the Source Code, enables
* supplementary functions or services in addition to those offered by
* the Software.
*
* Rudder is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Rudder. If not, see <http://www.gnu.org/licenses/>.
*
*************************************************************************************
*/


-- Migration script to create index on fileformat of eventlogs
-- this may take several minutes on very large database (more than 100 000 eventlogs)

CREATE INDEX eventlog_fileFormat_idx ON eventlog (((((xpath('/entry//@fileFormat',data))[1])::text)));

2 changes: 1 addition & 1 deletion rudder-core/src/main/resources/reportsSchema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ CREATE TABLE EventLog (

create index eventType_idx on EventLog (eventType);
create index creationDate_idx on EventLog (creationDate);

CREATE INDEX eventlog_fileFormat_idx ON eventlog (((((xpath('/entry//@fileFormat',data))[1])::text)));


create sequence GroupsId START 101;
Expand Down

0 comments on commit 7d6817b

Please sign in to comment.