[Monetdb-developers] Tuple reconstruction algorithm
Dear all, I'm trying to understand the tuple reconstruction algorithm in MonetDB. Maybe someone can give me a short overview to understand it or the place in documentation where I can do some research. As far as I understood, the BAT consists of object-ids and values. Is the object-identifier the same as the record- or tuple-identifier? If it so, is there a special mechanism to position a specific oid in a BAT or must it be scanned to find a oid? And if not, how can I determine the corresponding values in different BATs to reconstruct a tuple? Or am I totally wrong and there is an obvious way to reconstruct tuples from different BATs? Thanks in advance, Tim
Hi Tim, thanks for you interest in MonetDB. In general, the recommend way to use MonetDB is via SQL, i.e., staying in the standard multi-column relational world. Then, MonetDB (in particular its SQL front-end) will automatically and transparently take care of using the most efficient internal algorithms to perform tuple reconstruction as required by your SQL queries. In case you're curious how your SQL queries are translated into MonetDB MAL plans, just prefix your SQL query with key word "EXPLAIN" and study the output. Further, for any set of BATs the represent the individual columns of a relational table, the BATs' "heads" (first/left column) are aligned and consist of OIDs that form a dense (i.e., increment == 1) ascending sequence of integer numbers starting at a given offset (usually 0). Thus, these OIDs can indeed be seen as tuple-/record- identifiers. Be aware, though, that these OIDs are only used internally and not available as tuple-/record- identifiers in SQL. Given their denseness properly, these OIDs are usually not materialized (read: physically stored) but rather computed on the fly, and they effectively indicate (module offset) the physical position of the respective record's attribute values in all BATs involved. Thus, MonetDB internally exploits very efficient positional lookups (i.e., a "perfect index") for tuple reconstruction, e.g., via MAL operations like algebra.join(), algebra.find(), algebra.fetch(), etc. But as said, if you stay in the SQL world, you don't have to deal with this yourself, as MonetDB automatically takes care of all this for you. I hope this helps you further. In case you indeed need to use MAL directly --- for what reason and what purpose? --- we could give you some more pointers. Kind regards, Stefan On Mon, Jul 04, 2011 at 05:05:32PM +0200, Tim Speier wrote:
Dear all,
I'm trying to understand the tuple reconstruction algorithm in MonetDB. Maybe someone can give me a short overview to understand it or the place in documentation where I can do some research.
As far as I understood, the BAT consists of object-ids and values. Is the object-identifier the same as the record- or tuple-identifier? If it so, is there a special mechanism to position a specific oid in a BAT or must it be scanned to find a oid? And if not, how can I determine the corresponding values in different BATs to reconstruct a tuple? Or am I totally wrong and there is an obvious way to reconstruct tuples from different BATs?
Thanks in advance, Tim
------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
-- | Stefan.Manegold @ CWI.nl | DB Architectures (INS1) | | http://CWI.nl/~manegold/ | Science Park 123 (L321) | | Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
participants (2)
-
Stefan Manegold
-
Tim Speier