[Qa-debsources] DB modification for cloc plugin

Stefano Zacchiroli zack at debian.org
Wed Apr 20 14:22:53 UTC 2016


On Thu, Apr 14, 2016 at 11:30:32PM +0200, Orestis Ioannou wrote:
> > Or, if you feel funny enough, we can use cloccounts, which is just one
> > character away from sloccounts, but is incidentally also very
> > semantically appropriate.  I think with indexes doing the aggregate by
> > package would actually be really fast, and could be done on the fly,
> > rather than having a separate dedicated table. It's worth being tested,
> > but I'm actually pretty confident it'd work fine.
> 
> cloccounts seems good to me :)
> Do we need a package_id in the table for the indexes or this is not what
> you meant?

I didn't notice the absence of a package_id when writing my previous
email, but yes: having one would be good for GROUP BY.

And in fact even for faster deletes upon package removal. We have
noticed with other tables that ON DELETE CASCADE is much faster if we
have a direct "link" to packages, rather than relying on "transitive"
removal chains packages -> files -> other stuff. Please add one.

> > Question: can cloc actually return multiple languages for the same file?
> > 
> > (The above constraint seems to conservatively assume that it could,
> > which is a nice assumption for the DB, but I'm curious anyhow)
> 
> So the thing is that i thought it could return many languages per file.
> For example a html file with some php in it etc. But i tested this today
> and its not working like tihs. But at the beginnning this is why i
> thought of an id because the unique constraint wouldn't work.
> 
> I ll ask the author about this and modify accordingly.

We discussed this on IRC. For the records: cloc currently cannot detect
multiple languages per file, but the author is working on it.

Having a data model that supports both option is good anyhow, so I don't
think we need to change anything on this part of your proposal.

> ACK. Thanks again both of you for the review :)

Thank you for pushing Debsources development forward :)

Cheers.
-- 
Stefano Zacchiroli  . . . . . . .  zack at upsilon.cc . . . . o . . . o . o
Maître de conférences . . . . . http://upsilon.cc/zack . . . o . . . o o
Former Debian Project Leader . . . . . @zacchiro . . . . o o o . . . o .
« the first rule of tautology club is the first rule of tautology club »
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/qa-debsources/attachments/20160420/7e428d67/attachment.sig>


More information about the Qa-debsources mailing list