[PATCH 03/11] Add index for patchwork_comment (submission_id, date)

Stewart Smith stewart at linux.ibm.com
Mon Sep 10 12:26:49 AEST 2018


Stephen Finucane <stephen at that.guru> writes:
> On Fri, 2018-08-10 at 18:00 +1000, Stewart Smith wrote:
>> This (at least theoretically) should speed up displaying comments
>> on patches/cover letters. It's an index that will return rows
>> in-order for the query that we always do ("give me the comments
>> on this submission in date order"), rather than having to have
>> the database server do a sort for us.
>> 
>> I haven't been able to benchmark something locally that shows
>> this is an actual improvement, but I don't have as large data
>> set as various production instances. The query plan does look
>> a bit nicer though. Although the benefit of index maintenance
>> versus how long it takes to sort things is a good question.
>
> Indexes scare me purely because there aren't clear "this is when you do
> this" and "then is when you don't do this" guidelines :) However, I
> trust your DB knowledge here and it should be easy to revisit this so

Hopefully we can get some index use statistics out of some big live
sites and inform what we should keep / drop based on real data rather
than gut feelings.

-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Patchwork mailing list