S
S
Sergey750il2021-12-04 01:08:18
WordPress
Sergey750il, 2021-12-04 01:08:18

How to store the value of custom fields in the database as efficiently as possible?

Good day. In one TK I saw the following phrase:

The values ​​of custom fields must be stored in the database as efficiently as possible so that when working with them there is no heavy load (for example, if we have 40 different parameters on the page, then with the standard solution it will be 40 requests to the database, we need to reduce this value as much as possible).

What did you mean by "effective storage" and how is it done in the EaP?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WP Panda, 2021-12-04
@Sergey750il

They wrote the bullshit.

(for example, if we have 40 different parameters on the page, then with the standard solution it will be 40 queries to the database, we need to reduce this value as much as possible).

There is only one request, that 1 field, that 100 there the receipt goes through get_metadata_raw in which the result of the request is cached and all get_post_meta calls for the record, after the first one, stop at this cache and do not run to the database

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question