Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/62857


Change subject: Add index to securepoll_options.op_election
......................................................................

Add index to securepoll_options.op_election

Change-Id: I027bd1499c0e43d494771482b3e4fe9998c4564e
---
M SecurePoll.pg.sql
M SecurePoll.php
M SecurePoll.sql
A patches/patch-op_election-index.sql
4 files changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecurePoll 
refs/changes/57/62857/1

diff --git a/SecurePoll.pg.sql b/SecurePoll.pg.sql
index bb51777..18ebece 100644
--- a/SecurePoll.pg.sql
+++ b/SecurePoll.pg.sql
@@ -70,6 +70,7 @@
     REFERENCES securepoll_questions(qu_entity) ON UPDATE CASCADE ON DELETE 
CASCADE
 );
 CREATE INDEX spop_question ON securepoll_options (op_question, op_entity);
+CREATE INDEX spop_election ON securepoll_options (op_election);
 
 
 -- Voter list, independent for each election
diff --git a/SecurePoll.php b/SecurePoll.php
index 2e2e486..e964f95 100644
--- a/SecurePoll.php
+++ b/SecurePoll.php
@@ -137,6 +137,9 @@
                        $updater->addExtensionTable( 'securepoll_entity', 
"$base/SecurePoll.sql" );
                        $updater->modifyField( 'securepoll_votes', 'vote_ip',
                                "$base/patches/patch-vote_ip-extend.sql", true 
);
+                       $updater->addExtensionIndex( 'securepoll_options', 
'spop_election',
+                               "$base/patches/patch-op_election-index.sql"
+                       );
                        break;
                case 'postgres':
                        $updater->addExtensionTable( 'securepoll_entity', 
"$base/SecurePoll.pg.sql" );
diff --git a/SecurePoll.sql b/SecurePoll.sql
index f87527a..e4edc18 100644
--- a/SecurePoll.sql
+++ b/SecurePoll.sql
@@ -89,7 +89,6 @@
 
 
 -- Options for answering a given question, see Option.php
--- FIXME: needs op_election index for import.php
 -- FIXME: needs op_index column for determining the order if shuffle is off
 CREATE TABLE /*_*/securepoll_options (
        -- securepoll_entity.en_id
@@ -100,6 +99,7 @@
        op_question int not null
 ) /*$wgDBTableOptions*/;
 CREATE INDEX /*i*/spop_question ON /*_*/securepoll_options (op_question, 
op_entity);
+CREATE INDEX /*i*/spop_election ON /*_*/securepoll_options (op_election);
 
 
 -- Voter list, independent for each election
diff --git a/patches/patch-op_election-index.sql 
b/patches/patch-op_election-index.sql
new file mode 100644
index 0000000..48f4a76
--- /dev/null
+++ b/patches/patch-op_election-index.sql
@@ -0,0 +1 @@
+CREATE INDEX /*i*/spop_election ON /*_*/securepoll_options (op_election);
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/62857
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I027bd1499c0e43d494771482b3e4fe9998c4564e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SecurePoll
Gerrit-Branch: master
Gerrit-Owner: Reedy <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to