apaffenholz / pypolydb

a small python wrapper for polydb
GNU General Public License v3.0
0 stars 1 forks source link

searching for some f-vector #3

Open fchapoton opened 2 weeks ago

fchapoton commented 2 weeks ago

Is there a way to search for a given f-vector in all available collections ?

For example, I would like to search for (16,24,10,1) without any a priori idea where to look..

apaffenholz commented 2 weeks ago

Not directly.

On the technical side, recent versions of mongodb do have a join-command, but I have no expericence with this.

On the mathematical side, not all collection do have the f-vector stored, and there is no server-side computation. Also, for many collections there is no sensible notion of an f-vector for the objects.

You can get a list of available collections, and for each check in the schema whether there is an f-vector stored for the objects (this information is in the "required" section of the schema). I could write a convenience function that directly lists the available properties in a collection. You can then iterate over the list of collections providing the f-vector of its objects and check for your specific one.

Again, on the technical side, querying for vectors is very slow, if it finishes at all. So you should help mongo with the query and also add, e.g., the dimension and number of vertices or facets as the first entries of the query document. This allows mongo to use indices on the collection, which will significantly reduce the query time.