How to improve performances using flattening

Panda3D already takes care of (1). If you call flattenStrong() on a bunch of nodes, it will only merge nodes that share the same texture and material.
As for (2): in general, the more things are grouped together, the better, as long as you don’t group objects together that aren’t going to be in view at the same time.
This is most effective when the models share textures and materials, such as a range of trees in a forest or buildings in a village, so you should probably focus on that when grouping.

So the strategy should probably be: find groups of similar geometry that remain static with respect to each other, and flatten them together. If your scene is already in octree or quadtree format, this is fairly easy; flatten all the leaf nodes at the n’th level, where n represents a trade-off between culling and drawing performance.

It should be noted that it is not always the case that a single node remains. As stated earlier, Panda can’t flatten together nodes with different textures, or materials, or render attributes in general. (A workaround is to use bigger textures and UV map different model parts to different segments of the same texture.) In the worst case, which is if every piece of geometry has a different material, the number of geoms remains completely untouched, which should be noted also happens if the model structure is already as compact as can be.