G
G
g_oo_gle2015-10-04 17:41:32
PHP
g_oo_gle, 2015-10-04 17:41:32

How to build a database structure on a weak server?

The situation is this, there is a server, but due to its small characteristics, constant drops occur.
This is all due to my constant requests to the database
. Since I understand that frequent access to the database is bad, I ask you for advice
. There is a "post", after it is created, it is created table with comments to it
There is a "user", after registration of which a table with his posts is also created, etc., etc.
So, there are too many tables, it seems that this is not good
. Do you know how I sample comments on a post ?
I check the entire database by key (id and something unique in general, post number, for example)
I get the same unique key from this table and start searching the entire database for a table with comments
. Do you think this is normal?
Or is there some simpler and less demanding way?
I heard about the tables in which the keys for the tables are located, dig in this direction?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Pavlenko, 2015-10-04
@g_oo_gle

You are doing everything right. It's only a question of whether you're using indexing; how many comments and articles you have on your site.
In a good way, everything should work fine for you, and somehow you can only improve performance extensively (buying a more powerful server)

D
Denis, 2015-10-04
@prototype_denis

There is a "post", after its creation, a table is created with comments to it
There is a "user", after registration of which a table is also created

Something is clearly wrong here...

@
@mswindu, 2015-10-04
_

So, there are too many tables, it seems that this is not good

It seems right. There should be one table with users, a table with posts. Tables must have appropriate indexes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question