Database Table "Areas" Unoptimized?

Permalink
Hello folks.
So im relative new to Concrete. as you most likely know.
That means messing around a bit experimenting with the dashboard/ edit mode.

I noticed that the database table "Areas" just keeps growing and growing.
One would think that if you delete a "layout" you have added to example "Main area"
It would delete the the record in the database table. but i dosent seems to do that.

Here is what you can do to test this.
1. Enable Edit mode.
2. Add a new layout.. example with 3 colums.
3. Publish the page. "(3.5) go in to the db and see it added the record."
4. Go back to Edit Mode and delete the layout you added.
5. Publish the page. "(5.5) go in to the db and see it did not delete the entry in the db."

6. Keep looping thought step 1-5 and you will see that the table just keeps growing.

Im not sure if its intended to be like this. to me it seems like.
1. A bug.
2. Or its imo, a bad design choice letting the db just grow like this then the layout is no longer in use..

Some explanation would be nice

Btw. im using concrete 5.7.5.6

Regards.
Nuxil

 
Mnkras replied on at Permalink Reply
Mnkras
This is intentional.

concrete5 keeps versions of your pages, so that you can revert them if need be, while the tables may grow, the actual amount of data in each row is miniscule. It is merely keeping track of the relational IDs for the areas (and blocks) for each version of the page.

Mike
nuxil replied on at Permalink Reply
Ok. that explains some.

But that raises anohter question.
Why does the automated job not get rid of them. ?
The one in the dashboard -> system settings -> Optimization -> Automated jobs -> "Remove Old Page Versions"

I have like only a few pages. and like over 1200 rows in my areas table.
I do for sure not have this many layouts. I do like to clean this up somewhat.
With a standar install its around 130 i think. using the elemental theme.
I do not use layout extensivly so when i see 1200+ in my db i get the chills.
Considering the few pages there is.

Odd there isnt a way to purge ALL "junk/history"
Mnkras replied on at Permalink Reply
Mnkras
Figuring out what areas are in use is basically impossible.

An area can be created at runtime, for example,

$a = new Area('Sidebar ' . $num);


There is no way for us to if/when that area will be shown since $num could be anything.
The actual amount of data stored in that table is minuscule, you really shouldn't worry about.

We could keep track of when an area was last accessed, but what happens if a page isn't accessed for a long time, it could be accidentally removed.

Mike