What is table flattening? Can someone please explain it by an example.

Chandresh
Tera Guru

I went through the Wiki Article but didn't get the whole idea of Table Flattening.

2 REPLIES 2

sergiu_panaite
ServiceNow Employee
ServiceNow Employee

Hi Chandresh,



In releases before Dublin, we had physically on database side a table for task, incident, change_request, etc (one physical table for each extension of task). Starting with Dublin we introduced task flattening. Task flattening means we have now physically only one table, task, and all its extensions were incorporated in this table. So on database side we only have now task table, but on instance side we logically have each extension of task as a table defined in Dictionary.



The advantage of task table flattening is that we no longer need to run expensive JOINs on database side (for example getting incidents means we need to do a JOIN between incident table and task table before task flattening, after task flattening we only do a simple query on task table). From this point of view, there is a improvement especially on read operations (SELECTs). On the other hand having a much larger table can cause a bit of slowness when the table is altered (adding a new column on logical incident table for example will cause entire task table to be altered on database side), therefore any update sets or any column modification on task (adding/deleting/changing) should be done usually outside office hours or in low traffic periods.



Hope this helps, if you need more information let me know.



Regards,


Sergiu


we have restored database backup in our sever for generate additional reports, but in that 

task , incident, and change_request tables are missing. no idea how to find details regarding this.

 

please provide the solution on this.