Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
16554 Vistas

Hello,

Data of computed field is not storing in database . Is there any particular reason for making computed field so ?

What is the benefit of not storing value of computed field in database ? Can anyone explain it in detail ? Please give a complete explanation. 


Thanks & Regards

Avatar
Descartar
Mejor respuesta

Hello

 [ By default, a computed field is not stored to the database, and is

computed on-the-fly. Adding the attribute ``store=True`` will store the

field's values in the database. The advantage of a stored field is that

searching on that field is done by the database itself. The disadvantage

is that it requires database updates when the field must be recomputed. ]

Avatar
Descartar
Mejor respuesta

Hi Nikesh,

We use computed fields, if the value of field is computed using some logic and depends on other fields. For example: Total in Sale order is computed from sum of line subtotal

Computed field compute its value every time we access its value instead of reading from database.

By default, a computed field is not stored to the database, and is computed on-the-fly. Adding the attribute store=True will store the field's values in the database. The advantage of a stored field is that searching on that field is done by the database itself. The disadvantage is that it requires database updates when the field must be recomputed.

For more please check Link


Hope this helps.

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
mar 15
4242
1
ene 17
5001
2
mar 24
2389
3
ago 15
5086
4
sept 24
21273