Make taxonomic coverage link to articles
When you get to the end of the taxonomic tree it shows 1,2,3 or whatever references, but no link to the actual references. (On safari anyway). Suggest adding it (possibly higher taxa too) as a side-table as you browse.
@timrobertson100 Thanks for the tip on smallint and MyISAM.
I've used nested sets in other projects. Can't recall why I didn't for this one, possibly because I needed paths for the tree display of CoL names found in a reference, and just reused that code.
Indeed I do. Myisam for example is much quicker with smallInt instead of int. Obvious of course, but easily overlooked. We got some queries from minutes to seconds by addressing this on some larger tables.
Nested sets work well as you can hit the join table with
select articleId, count(*) as count from taxa_article where taxonLft between x and y group by articleId order by count desc;
It is a range scan on the index, but should be fast enough to query (ajax - 'loading...') on click
Building a nested set on CoL will take about 5-10mins (at runtime) of tree walking in PHP. Start at root, navigate to a leaf keeping a stack of parents and another stack of the LFT you assigned to the parent. When you leave a node, you update RFT and RGT at the same time (so only 1 update per taxon). The stack will only ever get to 7 long in CoL (kingdom, p, c, o, sf, f, g, s ranks).
We find nested sets work well for quickly aggregating stuff when looking at higher rank taxa. (Expect GBIF specimen maps to be identified like this in coming months.)
Hope this helps.
@timrobertson100 I'm using a path string as the index, rather than nested sets. Haven't checked whether nested sets would be faster.
Can you expand on "(I have done a lot of large tables and the effect of using the smallest numeric type possible is very significant for these kind of tables)"? Do you mean that the index should be the smallest integer field possible?
Out of curiosity, how do you store all your indexes Rod? If it were an RDBMS, and if you run a nested set on the taxonomy, a simple table of the following would suffice:
taxonLft, articleId, pageId
(I have done a lot of large tables and the effect of using the smallest numeric type possible is very significant for these kind of tables)
Good idea. I'd thought of having thumbnails of the references in the treemap (using, for example, a quantum treemap http://dx.doi.org/10.1145/571647.571649 ). I'll explore this idea further.