diff --git a/db/install.xml b/db/install.xml
index cc7ccba..9466cdf 100644
--- a/db/install.xml
+++ b/db/install.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="mod/questionnaire/db" VERSION="20080410" COMMENT="XMLDB file for Moodle mod/questionnaire"
+<XMLDB PATH="mod/questionnaire/db" VERSION="20090610" COMMENT="XMLDB file for Moodle mod/questionnaire"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
 >
@@ -158,6 +158,9 @@
       <KEYS>
         <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
       </KEYS>
+      <INDEXES>
+        <INDEX NAME="response_question" UNIQUE="false" FIELDS="response_id, question_id, choice_id"/>
+      </INDEXES>
     </TABLE>
     <TABLE NAME="questionnaire_response_other" COMMENT="questionnaire_response_other table retrofitted from MySQL" PREVIOUS="questionnaire_resp_multiple" NEXT="questionnaire_response_rank">
       <FIELDS>
diff --git a/db/upgrade.php b/db/upgrade.php
index 39dfdcb..ec23f37 100644
--- a/db/upgrade.php
+++ b/db/upgrade.php
@@ -188,6 +188,14 @@ function xmldb_questionnaire_upgrade($oldversion=0) {
         $result &= change_field_notnull($table, $field);
     }
 
+    if ($oldversion < 2008060403) {
+        $table = new XMLDBTable('questionnaire_resp_multiple');
+        $index = new XMLDBIndex('response_question');
+        $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('response_id', 'question_id', 'choice_id'));
+
+        $result = $result && add_index($table, $index);
+    }
+
     return $result;
 }
 
@@ -231,4 +239,4 @@ function xmldb_questionnaire_upgrade($oldversion=0) {
     
         return $status;
     }
-?>
\ No newline at end of file
+?>
diff --git a/version.php b/version.php
index d87ad7e..78271b0 100644
--- a/version.php
+++ b/version.php
@@ -5,7 +5,7 @@
 ///  This fragment is called by moodle_needs_upgrading() and /admin/index.php
 /////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2008060402;  // The current module version (Date: YYYYMMDDXX)
+$module->version  = 2008060403;  // The current module version (Date: YYYYMMDDXX)
 $module->requires = 2007101000;  // Requires this Moodle version
 $module->cron     = 60*60*12;    // Period for cron to check this module (secs)
 
