D
D
Daniel2018-04-13 16:19:00
Database
Daniel, 2018-04-13 16:19:00

How are databases organized?

For a month now I have been trying to find how the database is arranged, and I can’t find keywords in any way so as not to find this CREATE table, INSERT, etc. those. its application directly, and several good articles on the hub.
How exactly is the location of data in relational databases, exactly how data is inserted and instantly searched, this is a type of offset control, i.e. As I guess, for the users table (u id : integer, name:varchar(32), pass:varchar(32) ), the search by id is done by baseOffset(the position of the beginning of the first row of the table) , length= is one row long, i.e. e. 4+32*2+32*2 = 132. And the search by id will be something like this [ baseOffset+ i * 132 ] , and the data of dynamic types of the Text type is referenced by links indicating their location and offset-a. Am I guessing correctly.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
DDDsa, 2018-04-13
@DDDsa

Here is a good article

S
Stanislav Makarov, 2018-04-13
@Nipheris

What you are looking for is called the physical database model . You can google it, including adding the word "relational".
Here in this book (translation: "Database systems. Full course" ) open the Database System Implementation section and the first two sections - Secondary Storage Management and Index Structures and forward.

M
Melkij, 2018-04-13
@melkij

4+32*2+32*2 = 132

I’m even wondering why you came up with the idea of ​​multiplying by 2. I honestly don’t know common encodings of a fixed two-byte width. Usually we are talking about either a bunch of single-byte or variable-length encodings.
Search by offset in the datafile - yes, it does. But in the general case, it has absolutely nothing to do with the structure of the SQL level table.
For example, a brief look at postgresql internals: momjian.us/main/writings/pgsql/internalpics.pdf

I
igorzakhar, 2018-04-16
@igorzakhar

https://habrahabr.ru/company/mailru/blog/266811/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question