T
T
taurus902014-12-24 05:47:15
SQL
taurus90, 2014-12-24 05:47:15

Benefits of "segmenting" tables in a SQLite DB?

The next task is to create a database structure for storing, among other things, objects of the "post" type. There can be thousands of them, each post has its own author (author_id).
Does it make sense (for speed) to create for each author its own table "posts_##autor_id##", for example, users with IDs 0 and 1 will have their own tables "posts_0" and "posts_1"?
Operations on posts - complete deletion by author (rare), getting with sorting / condition only from the author, getting all posts from all authors (often).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
MonkAlex, 2014-12-24
@MonkAlex

>> getting all posts from all authors (often).
this frequent operation will require join constants over an unlimited number of tables.
Of course, when there are thousands of posts in the table, a sorting query may not be fast either, but it seems to me that it would be more profitable to do it in one table all the same.
PS: I'm not particularly savvy in SQL, my opinion can be ignored.

I
Ilya Evseev, 2014-12-24
@IlyaEvseev

SQLite is not for speed, but for simplicity.
You need a (No)SQL server for speed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question