11 Jun, 2015

1 commit

  • Whenever you have 2 or more tags with the same name but different cases,
    ActsAsTaggableOn returns an empty list of objects tagged with either of
    the tags. To solve this problem, we must not have tags with different
    cases stored.
    
    Performance was my primal concern on this migration since we have
    instances that have over 130k tags registered. So I decided to convert
    every tag to lower case.  This is the fastest way I could conceive this
    migration and still it might take a lot of time. Here is basic resume of
    what it basically does:
    
      x: number of new downcased tags created.
      y: number of oddcased tags.
      z: number of tags
    
      1. Find all tags do not have a downcased form already created - [1 fast select query].
      2. Create a downcased version of the above queries - [x slow update queries but
      n is usually low because a minority of tags have odd case and all
      different cases of a single word generate only 1 query].
      3. Update taggings relations based on new ids - [1 slow update and 2 join queries].
      4. Updates the taggings_count of every tag - [1 slow update with z fast selects]
      5. Delete all unused tags tags - [1 slow delete query].
    
    Signed-off-by: Larissa Reis <larissa@colivre.coop.br>
    Rodrigo Souto
     

08 Jun, 2015

3 commits


05 Jun, 2015

2 commits


03 Jun, 2015

2 commits


02 Jun, 2015

14 commits


01 Jun, 2015

11 commits


31 May, 2015

2 commits


30 May, 2015

3 commits


29 May, 2015

2 commits