BD query without overloading the server

Asked

Viewed 100 times

4

Hello folks good night!

I need to perform several queries of an ID in an X table, but this is overloading my server and the connection with the BD gets off, I contacted my server and informed me that I am trying several requests and so it is offline.

So I wonder if it is possible for me to create a new column and store all the information and forget the relationship between tables.

Since I don’t think I expressed my doubt very well, I’ll leave a flow chart below: Fluxo grama

I’ve seen data entered this way but I can’t remember what it is like, if someone can help me with the name of the function or an example, I really appreciate it.

@UPDATE I think I found what you wanted guys, I think it’s json_encode, I’ll see how it works, if it’s not that please tell me.

  • Here are some basic questions, which are the most important: 1. You have access to root server? 2. You have the ability to change the my.cnf or your database configuration file? 3. Are you using Mysql, which database are you using? Predicting possible answers: If you don’t have access root possibly there is no way to actually fix the problem, as you will not be able to change the my.cnf, in most cases. "There is no such thing as "BD gets off", only if it is corrupted or damaged (because it actually shuts down). See in Mysql logs the error that displayed.

  • 1

    What a json_encode has to do with the performance of a comic book?

  • Using json_encode I can save the information from the second table in the first, right? According to what I thought doing this would make my database more stable. I don’t know what really happens, when my site goes from 1k online to connection to the database fell.

1 answer

2


Yes it is possible.

What you are wanting to do is DENORMALIZE a database for performance gain.

Remembering that there is no "cake recipe" on normalization. It will depend a lot on each situation.

There are several articles about this on the Internet, for example: NORMALIZATION vs DENORMALIZATION

Also remember to create database indexes for fields that are used in filters (where) or ordination (order by), 'cause it’ll help the performance too.

  • Thank you for the polite response, I will study what you mentioned above.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.