Re: shredding users

Alex Vandiver <[email protected]>
Newsgroups gmane.comp.bug-tracking.request-tracker.devel
Organization Best Practical Solutions, LLC
Message-ID <[email protected]>
On 07/17/2014 09:23 AM, Wallace Reis wrote:
> On Jul 17, 2014, at 10:07, Christian Loos <[email protected]> 
> wrote:
>> Hi,
>> 
>> shredding users, the longest database part was this query:
>> SELECT main.* FROM Attachments main  WHERE (main.Creator = '123')
>> ORDER BY main.id ASC
>> 
>> Beside maybe mentioning an index on Attachments.Creator for 
>> shredder and maybe omit the sorting, wouldn't it be better to 
>> "SELECT main.id FROM Attachments ..." which wouldn't send the 
>> Content column?
> 
> Hi,
> 
> It depends on the RT instance you have. Have you analysed the
> query plan of original query? How about the proposed solutions?
> Without looking at that, it sounds like that the first two things
> you suggested about the index and sorting would provide way more
> gain than just removing columns from the retrieval list if it’s for
> a RT instance where attachments are basically small (about a few
> hundreds of KB).

There's no reason to _not_ limit the set of columns down.  The index
will probably help the most, I agree -- removing the sort is unlikely
to make much difference, as sorting by the primary key is pretty cheap
in most databases.
 - Alex
-- 
RT Training - Boston, September 9-10
http://bestpractical.com/training
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.