Deleting large chunks of data

Hello All,

There is larger amount of data in an entity from past 2-2.5  years which consists of millions of records,which resulting timeout of sql queries using the table mentioned and proposed solution was to move data from it another table(If in case something to do with old data required) which is older than last 4 months inorder to make queries fast.

Is it best way to do? or Any ideas appreciated.

Hi! 

You can use an "Advanced SQL" for that . 

with a SQL statement like  

Delete from {MyEntity} where {MyEntity}.[MyDate]< @LimitDate

@LimitDate is a parameter, you can send the value you want.

Hope this helps

Graça

 

As Graça suggested you can use Advanced SQL for deleting large volumes of data. Works like a charm . Additionally bind the logic to  a timer so that the cleanup keeps on happening periodically. 


Cheers,

Tushar 


HI Naren..!


You can use the Advanced Sql 




DELETE FROM {Entity Name} WHERE {Entity Name}.[attribute_name] BETWEEN From_date AND To_date;



As Graça suggested you can use Advanced SQL for deleting large volumes of data. Works like a charm . Additionally bind the logic to  a timer so that the cleanup keeps on happening periodically. 


Cheers,

Tushar 



Thanks All,

The approach is to create a another table and move these data to the newly created table,Can we acheive it?

I know the SQL way of doing it,Can we do with the same implementation?

Hello Daniel,

Thanks for the help,I hope this will workout which i realised after seeing the article.