Add indices for history tables

RESOLVED FIXED

Status

()

RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: rnewman, Assigned: rnewman)

Tracking

({perf})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

47 bytes, text/x-github-pull-request
rnewman
: review+
Details | Review | Splinter Review
(Assignee)

Description

4 years ago
We currently have none at all. That'll very rapidly bite us. I intend to fix this as part of, or immediately after, the schema changes in Bug 1163273.
(Assignee)

Updated

4 years ago
Blocks: 1166812
(Assignee)

Updated

3 years ago
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
Summary: Add indices for database tables → Add indices for history tables
(Assignee)

Comment 1

3 years ago
Created attachment 8608880 [details] [review]
Pull req.

There's one commit near the end of this PR.

I added only two explicit indices. All of the UNIQUE and PRIMARY KEY columns get an index for free. So I added two:

* An index on should_upload, because otherwise that'll be a table scan for a very small set. Thinking about this, I should make this a partial index on should_upload = 1.

* A compound index on visits.{siteID,date}, because we're always doing a join and datewise comparisons in the same query.
Attachment #8608880 - Flags: review?(wjohnston)
(Assignee)

Comment 2

3 years ago
I made the index partial and rebased.
(Assignee)

Comment 3

3 years ago
Reviewed in GH. c68aac4
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
(Assignee)

Updated

3 years ago
Attachment #8608880 - Flags: review?(wjohnston) → review+
(Assignee)

Updated

3 years ago
Blocks: 1137462
(Assignee)

Updated

3 years ago
Blocks: 1169322
You need to log in before you can comment on or make changes to this bug.