How RDBs like MySQL and PostgreSQL manage memory for new indexes?
My guess that RDB creates B-tree (or other indexes) with References/Links to real objects in memory.
Another guess that it duplicates all the data for each new index.
So basically this question is about “What B-tree consists of? References, or real objects?”
Google search is too overheat about DB topics and RDMS products. So, I also would be very grateful for good articles about this.
The details vary, but a B-tree index is a tree structure that is stored on disk. It contains duplicates of the indexed terms (the index keys) and a (direct or indirect) pointer to the indexed row in the table.
A B-tree index represents a sorted list of the index keys that allows fast searches. The tree structure speeds up searching through the list and allows inserting and deleting entries without too much data churn.
It is unclear what you mean by a “real object”. The index keys are certainly real, and they are stored in the index. But if you mean the whole table row, that is only referenced from the index.