2
Before posting this question I scoured the internet to know the differences and performance of each type and I came to the conclusion that I should discuss a little more on this subject here with experts, rs, I already know the differences between CHAR
, CHARACTER VARYING (Varchar)
and TEXT (Blob)
, but what is catching is the performance, according to the comments Varchar
and Text
had the same average in milliseconds, but it is not what I am going through in real, I have a system of medicine and safety at work, where one keeps many texts so I have opted for the type TEXT
, but this is costing me, the screens that need to open these fields has taken a long time, when hidden (retreat) the screen opens immediately.
The question is:
Can I use CHARACTER VARYING
without limiting characters as if it were TEXT
or I may have problems in the future?
The question is why I’ve been reading about TEXT
or BLOB
some banks store this field separately from the table and so should be used carefully, I explain, many people come out creating a table like this:
Nome: Text
Endereco: Text
Bairro: Text
The old custom of Access and this should not be done in relational banks. What is the experience of friends in this respect and what you would recommend?
I have taken all precautions regarding indexes, data types and selects
to improve performance, when there was little data was all right, now the base with tables of 6 million records the system begins to take longer than expected.
Maniero, I confess that I stood behind the "Tip" that the help of the postgres gives, in programming either there is difference or no, excerpt: "in fact it is usually the slowest of the three", so it is slower, 100 milliseconds in a record is insignificant, but at 6 million the thing changes of figure, if we are talking about performance then all requirements should be looked at with caution, use a TEXT field for a NAME for example, does not seem to me a good practice, then as the end recommends should use CHAR or CHARACTER VARYING, so I decided to put this topic to see the experience of the staff.
– Marcelo
Ali is talking about the
char
and not ofvarchar
, and even if it was, you’re saying that thetext
is slow, which he clearly says it is not. 100 milliseconds? Where did it come from? Even thechar
is only slower in specific circumstances where it was used where it should not and the difference is absurdly less than this, unless you are using an 80’s computer and have made achar
huge that only use a few characters. In fact, you need to be careful, start with, primarily to interpret texts.It says the opposite of what you’re saying.Documentation is the only reliable guide– Maniero
Calm and Maniero, the discussion here is precisely to eliminate doubts as to the type of field and not to discuss on the reliability of the postgres manual, really did not understand the manual so I am asking about the types, as I said I am a programmer and not DBA so my doubts, the fact that I have posted this topic is precisely by being cautious and not go out using any type anywhere, I am making sure with people like you who have knowledge of the cause, that’s all. When he says "Character(n)Character(n)textcharacter Varying", I thought I was out of the TEXT type.
– Marcelo
100 milliseconds could be 1 or 10 or 1000 is hypothetical... I’m sorry the discrepancy
– Marcelo