On Monday, 6 June 2016 14:09:42 UTC+1, Daniel Jagszent wrote:
>
> -- use this to get the inode of the archive folder
> SELECT * FROM contents_v WHERE parent_inode = 1;
>
> -- use this (replace parent_inode = 47 with the inode of the archive
> folder) to get the size of the folder on the Swift Store
> WITH RECURSIVE tree
> AS ( SELECT ... WHERE parent_inode = 47 ... )
>
Thank you for that query. At the high level it's been very useful to see
where my storage has been used.
I've been having a little dig around in the schema with a view to seeing
how I can perform a variation of du -ms for various parts of the tree,
comparing the ratio of stored to used data blocks. I'm curious to determine
the "most expensive" parts of my backups. I've had some interesting times
trying to drill down, though.
The SQLite concept of type-indifference has thrown me somewhat, and I
really struggled to turn your first explicit SELECT statement into a nice
easy-to-read WHERE clause for the main query. In the end I found that I
could replace your WHERE parent_inode = 47 with WHERE parent_inode = 1 AND
name = CAST('archive' AS blob). This is probably obvious to you and
Nikolaus but as a newcomer to the SQLite implementation of SQL I thought it
would be worth mentioning in case anyone else was struggling with this.
The whole WITH RECURSIVE is very clever, and while I can see what it's
doing I haven't yet become comfortable with *how *it does what it's doing.
(Yes, I've read documentation. Yes, I'm playing with example code.). I'm
sufficiently comfortable with recursion in a classical imperative
programming language, but in a supposedly declarative one such as SQL it's
been making my head hurt.
Regards,
Chris
--
You received this message because you are subscribed to the Google Groups
"s3ql" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.