Review Request 111797: populate the assetinfo with ratings

Aaron J. Seigo aseigo at kde.org
Tue Jul 30 15:10:52 UTC 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/111797/#review36816
-----------------------------------------------------------


a few small things to fix.


server/lib/db/assetinfo.js
<http://git.reviewboard.kde.org/r/111797/#comment27164>

    the DISTINCT will add overhead to the query; it's, and even then there are other possible database state that can result in more than one row.
    
    instead use LIMIT 1, which is the equivalent to not using DISTINCT but will still get just one item back.



sql/ratings.sql
<http://git.reviewboard.kde.org/r/111797/#comment27165>

    there is no reason to do 2 queries here.
    
    SELECT INTO average round(avg(rating), 1), count(rating) FROM ratings WHERE asset = assetId AND attribute = attributeId;


- Aaron J. Seigo


On July 30, 2013, 1:26 p.m., Giorgos Tsiapaliokas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/111797/
> -----------------------------------------------------------
> 
> (Updated July 30, 2013, 1:26 p.m.)
> 
> 
> Review request for Bodega.
> 
> 
> Description
> -------
> 
> This patch populates the asset/:assetId with the # of ratings and the average rating.
> Docs and tests are also being included. 
> 
> 
> Diffs
> -----
> 
>   server/doc/bodega.json f973bda 
>   server/lib/db/assetinfo.js 9e3755d 
>   server/test/assetinfo.js e46387a 
>   sql/ratings.sql 841045f 
> 
> Diff: http://git.reviewboard.kde.org/r/111797/diff/
> 
> 
> Testing
> -------
> 
> my test passes
> 
> 
> Thanks,
> 
> Giorgos Tsiapaliokas
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/active/attachments/20130730/c38eebdd/attachment-0001.html>


More information about the Active mailing list