optimize performance of table