From 9ae633ed7b3e1f53822bb32541132c6cc917ec3e Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 23 Jul 2013 12:16:57 +0000 Subject: [PATCH] add unique is enough no need to add index too --- pandora/item/tasks.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandora/item/tasks.py b/pandora/item/tasks.py index 291b166c9..62ec6c9af 100644 --- a/pandora/item/tasks.py +++ b/pandora/item/tasks.py @@ -36,8 +36,7 @@ def update_random_clip_sort(): cursor.execute('DROP TABLE clip_random;') cursor.execute('CREATE TABLE "clip_random" AS SELECT id AS clip_id, row_number() OVER (ORDER BY random()) AS random FROM "clip_clip"') cursor.execute('ALTER TABLE "clip_random" ADD UNIQUE ("clip_id")') - cursor.execute('CREATE INDEX "clip_random_clip_id_idx" ON "clip_random" ("clip_id")') - cursor.execute('CREATE INDEX "clip_random_random_idx" ON "clip_random" ("random")') + cursor.execute('CREATE INDEX "clip_random_random" ON "clip_random" ("random")') @task(ignore_results=True, queue='default') def update_clips(itemId):