Skip to content

Commit

Permalink
Added index on DeviceEvent table to optimize query for receivedOn DESC
Browse files Browse the repository at this point in the history
Signed-off-by: coduz <alberto.codutti@eurotech.com>
  • Loading branch information
Coduz committed Jul 8, 2020
1 parent 3bd77ae commit ca07e02
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2020 Eurotech and/or its affiliates and others
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Eurotech - initial API and implementation
-->
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd"
logicalFilePath="KapuaDB/changelog-device-1.3.0.xml">

<include relativeToChangelogFile="true" file="./device_event-index_received_on.xml"/>

</databaseChangeLog>
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2020 Eurotech and/or its affiliates and others
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Eurotech - initial API and implementation
-->
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd"
logicalFilePath="KapuaDB/changelog-device-1.3.0.xml">

<changeSet id="changelog-device_event-1.3.0_index_received_on" author="eurotech">
<createIndex tableName="dvc_device_event" indexName="idx_device_event_scope_device_received_on">
<column name="scope_id"/>
<column name="device_id"/>
<column name="received_on"/>
</createIndex>
</changeSet>

</databaseChangeLog>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2017 Eurotech and/or its affiliates and others
Copyright (c) 2017, 2020 Eurotech and/or its affiliates and others
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
Expand All @@ -21,5 +21,6 @@
<include relativeToChangelogFile="true" file="./1.0.0/changelog-device-1.0.0.xml"/>
<include relativeToChangelogFile="true" file="./1.1.0/changelog-device-1.1.0.xml"/>
<include relativeToChangelogFile="true" file="./1.2.0/changelog-device-1.2.0.xml"/>
<include relativeToChangelogFile="true" file="./1.3.0/changelog-device-1.3.0.xml"/>

</databaseChangeLog>

0 comments on commit ca07e02

Please sign in to comment.