Page MenuHomePhabricator

Create index for transactionType in phabricator_maniphest.maniphest_transaction
Closed, WontfixPublic


There are use cases for executing select statements for maniphest transactions where transactionType = "some:value" . Currently, transactionType is not indexed.

Adding an index would prevent these kind of statements from executing table scans which are extremely slow on this table because it is typically contains tens of thousands of rows.

Event Timeline

ChristopherHJohnson raised the priority of this task from to Needs Triage.
ChristopherHJohnson updated the task description. (Show Details)

Are those use cases in the upstream? We don't consider the table schema part of the public API, so if these use cases are purely third-party use cases we're very unlikely to pursue this.

Actually, yes. ManiphestReportController lines 95-97.

I'd also like this index:

CREATE INDEX dateCreated ON phabricator_maniphest.maniphest_transaction (dateCreated);

I am admittedly querying the tables directly.
My use case is finding all recently resolved tasks,
which seems common enough that there will be a
similar use case in the UI which will need this index.

See T4434 for recently completed objects.

epriestley claimed this task.

Our plan is to build a real reporting application ("Facts", T1562) and remove the cobbled-together reports UI. Cursor-based fact extraction doesn't depend on these indices. T4434 covers closed objects, although this will probably be extracted separately as well.