Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It depends on the nature of the data. If it's hierarchical you can use ORDPATH[1], which results in an index scan. You can use ORDPATH to further solve other queries with a bit of creativity (such as this ancestor/descendant querying structure for directed cyclic graphs[2] that we needed).

My spidey senses lead me to believe that you won't get far with optimizing CTEs in the query engine, especially if the backing temp table becomes too large for memory.

[1]: http://www.dbis.informatik.hu-berlin.de/fileadmin/lectures/W...

[2]: https://github.com/k2workflow/Clay/blob/master/src/SourceCod...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: