1

Topic: Whether I can trace somehow update/insert?

Whether I can somehow follows in some given tables that for a day changed? Interests at least insert/update thus without resorting to triggers?
If there are any ideas, advise, please, at least idea.
In advance thanks.

2

Re: Whether I can trace somehow update/insert?

It is possible to include  requests (on the server or, better, only the necessary requests in application) + to compose any handling.
As a last resort, daily  tables + any diff.
both that and another on the order is more difficult than the trigger.

3

Re: Whether I can trace somehow update/insert?

vkle;
Thanks vkle, a problem in that that it is necessary to trace 30 tables so it is necessary two triggers at least on insert and on update. Only 60 triggers. Such idea is not pleasant to me. I will try to convince the people to change tables adding fields inserted_at TIMESTAMP and updated_at on UPDATE TIMESTAMP.

4

Re: Whether I can trace somehow update/insert?

alexnews wrote:

I Will try to convince the people to change tables adding fields inserted_at TIMESTAMP and updated_at on UPDATE TIMESTAMP.

the Bad decision with the registration of the initial task. At UPDATE the information about previous INSERT and UPDATE will be lost.

alexnews wrote:

it is necessary to trace 30 tables so it is necessary two triggers at least on insert and on update. Only 60 triggers. Such idea is not pleasant to me.

Normal idea. There is in it nothing bad. And generation of triggers can and be programmed - one HP-shka, and all...

5

Re: Whether I can trace somehow update/insert?

Recently something similar considered.
Idea:
At night you do a backup copy, you tear it in other basis and you compare current basis to the yesterday's.

6

Re: Whether I can trace somehow update/insert?

Akina wrote:

it is passed...
The bad decision with the registration of the initial task. At UPDATE the information about previous INSERT and UPDATE will be lost.

Like, in the initial task was not about the full change history, only "that for a day changed". If only sampling novyh / the changed records for last how many hours then this decision seems quite comprehensible as a result is required.
However, I see a minus that all existing requests in the client application should be corrected. Using the trigger, it is possible to implement editing at level of tables, without touching requests in application.
And one more minus. Hypothetically, record can be and is remote, and it too some kind of change. Additional fields here do not help.

7

Re: Whether I can trace somehow update/insert?

vkle wrote:

only "that for a day changed"

If for a day there were some changes, see only the last. I personally perceive it as all history of change. If the author accepts only the list of the changed objects - well  yes.

8

Re: Whether I can trace somehow update/insert?

982183;
The problem in that that tables already on 15-35 million records, such simply not really to make.

9

Re: Whether I can trace somehow update/insert?

Akina;
Similar all arranges. I made triggers on the main tables, triggers collect  on any only id and that happened (insert/update) as the unique key costs on id. While all arranged. If it will be necessary I will remove uniqueness. And I will simply copy small labels completely there on 500-30000 records.
Thanks all for helps.