1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00
phorge-phorge/resources/sql/patches/069.heraldxscript.sql
epriestley 879431fb50 Improve GC performance for Herald Transcripts
Summary: This has to table scan a ginormous table right now, give it a fighting
chance with a more usable key.
Test Plan:
  - Launched GC daemon, no errors.
  - Used test console to create a new transcript.
  - Viewed some old transcripts.
  - Ran EXPLAIN on the SELECT and verified it was utilizing the garbageCollected
key.

Reviewed By: jungejason
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley, jungejason
Differential Revision: 735
2011-07-28 18:50:54 -07:00

9 lines
286 B
SQL

ALTER TABLE phabricator_herald.herald_transcript
ADD garbageCollected BOOL NOT NULL DEFAULT 0;
UPDATE phabricator_herald.herald_transcript
SET garbageCollected = 1
WHERE objectTranscript = "";
ALTER TABLE phabricator_herald.herald_transcript
ADD KEY (garbageCollected, time);