Hi guys, FIND REFERENCES command is not intended to be used in typical production environments. Links are unidirectional, so to find all the documents that refer to a single RID, OrientDB has to do a full scan of the database, this is operation will take a long time to execute.
We suggest to use FIND REFERENCES only to repair databases where you deliberately deleted records without updating their references. For normal use cases we suggest to: - use edges instead of links: edges are bi-directional (no need to execute FIND REFERENCES) and are automatically managed by OrientDB (they are automatically removed when you remove a connected vertex) - use links only in schemaful, indexed properties, so that you always know where to look for in case you manually remove a linked document There are no plans to make FIND REFERENCES faster, just because it would imply a huge performance impact on the whole architecture Thanks Luigi 2016-01-21 3:55 GMT+01:00 Hung Tran <[email protected]>: > Hi Scott, > > I have two use cases for this > > 1. Because OrientDB allows you delete any record even if they got > referenced by some other records. I need to check its references to know > when a record could be deleted, when it could be not and do a soft delete > instead, and all related records according to ORM model. For example, with > Sales model, when you delete an draft order, you will need also to delete > its all order lines but not delete any Product referenced by them. > > 2. I have a special use case, when a record is updated, it will do an > update only if that is not being referenced by others, otherwise it will do > an insert instead. > > Without that SQL, I will have to generate many SQL to compute its > dependencies. > > My Best, > Hung Tran > > On Thursday, January 21, 2016 at 2:01:51 AM UTC+7, scott molinari wrote: >> >> What do you need that command for? >> >> Scott >> > -- > > --- > You received this message because you are subscribed to the Google Groups > "OrientDB" 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. > -- --- You received this message because you are subscribed to the Google Groups "OrientDB" 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.
