vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| How do I efficiently find all objects in a given volume cell? I have simple building blocks stored with their min/max extent in three dimensions stored in Table 1: building blocks (id1, min x, max x, min y, max y, min z,max z) Objects built out of these building blocks are stored in Table 2: objects (id2, other properties) Each object consists of several blocks, and each block can belong to several objects, as stored in Table 3: relation12 (id1, id2) There are millions of objects and blocks, while only some 10 blocks make one object and one block in average belongs to less than 2 objects. Now I need to select all objects that intersect a volume (x0..x1,y0..y1,z0..z1). The problem that I see is that no key for the object dimensions exists, so they cannot be searched efficiently. Is it possible to implicitely define such keys, which would be the x,y,z minima and maxima of all related blocks? Or do I have to add (min x ... max z) columns to the object table 2 and update these values according to changes in table 1 and table 3? Thanks Robert |