0
Good guys, my problem is this, I want to make a table partitioning in postgres because a table has zillions of records and searching for it takes a lot (this table tends to grow considerably in the next months) and one solution I found was to make table partitioning (if anyone has another solution) using Trigger only that so far so good, but by the time I insert a die into my table it calls the kitten, I can get this information, only all the data comes in one piece. Some fields I can convert to text, but others like the date it does not convert neither to date nor to string, the question is how do I leave it with its standard data types? If there is no way to leave this date field with the date type.
Rarely is partitioning the solution, it is taking longer has something else wrong. Indexes make access almost equal regardless of table size. Even if you insist on this error, Trigger probably the worst resource to do this. The rest seems too confusing, and probably unnecessary. See: http://answall.com/q/35088/101, http://answall.com/q/101065/101, http://answall.com/q/32052/101, http://answall.com/q/23348/101, http://use-the-index-luke.com/
– Maniero
The database already has almost 1 Tera of data, only this table is 4 gigas and its trend is double in the next few months. The indexes help, but over time it gets slower. If you have another solution.
– Johnatan Dantas
I think you’re wrong. My experience and other people’s experience is different. And the data on how they work shows this. When the table doubles in size (no matter the size) when using index it is like adding a single new row to search for what you want. It’s so tiny, you can barely measure it. If you do what you’re trying to do, it’ll make all the recordings more expensive, which at a high volume can be tragic. I reaffirm that if you are having performance problems with index it is because you are doing something wrong.
– Maniero
No matter how many rows I have in a table, the indexes will always improve, because this table has over 500 million records. What you suggest I improve, this table already has indices that in the beginning was good, but now it is not advancing much.
– Johnatan Dantas
It would be good to put the structure of the tables in the question. Great chance to be modeling problem. As for partitioning with Trigger, I find misuse of the two features (Trigger, and partitioning).
– Bacco
@Johnatandantas, because you do not create a clone of the same table( I say call create table without the constraints and indices ) and make select only the data you want or scan a certain amount of data using limit?
– Wellington Silva Ribeiro