Re: recursive search

From: J.O. Aho <user_at_example.net>
Date: Sat, 10 Sep 2016 18:57:27 +0200
Message-ID: <e3isbnFit3dU1_at_mid.individual.net>


[Quoted] On 09/10/2016 06:27 PM, mireero wrote:
> Thanks for the answers.
>
> What I get is:
> - No recursive support in mysql (and might be handled by other database
> systems).
> - I can manually search with n joins if not going until the end is an
> option (not my case here).
>
> What I have is:
> - My app is not written around this recursive search, it's only one
> query among maybe 30.
> - I'd prefer the search to be fully recursive.
>
> Conclusion:
> I'll stick with mysql.
> I'll go with PHP.

[Quoted] [Quoted] I would recommend you to take the step over to MariaDB and it's oqgraph, the transition is quite simple, just uninstall the mySQL and install the MariaDB, run a database update as you would normally do when you upgrade your database. No need to change any code you already done and most distributions do provide MariaDB as a replacement for mySQL.

> I'll have a look at cursors (because I'm still learning and I'm
> interested).
> I do know basics of stored procedures but if you has hints/links about
> how to create a recursive search, I would appreciate (I know, I can also
> google it!).

[Quoted] [Quoted] Making a recursive stored procedure is kind of the same as making a recursive function, where you start with a starting point and then call the same sp, but now with the next generation. The cursor will work like a for-loop.

Just keep in mind, the more generations you have, the longer time it will take with mysql (or other traditional RDBMS), so if you will have many generations, you need other alternatives and even running logic in another layer will not be as fast as a graph-database.

I'm not talking you to replace the whole system with a graph-database, but take help of it where the mySQL ain't good enough.

-- 

 //Aho
Received on Sat Sep 10 2016 - 18:57:27 CEST

Original text of this message