is it a good practice to INSERT rows / SELECT rows in database using the main thread or i should dispatch an async queue in order to do this op? In this case.. what is the right thing of achieve this?
Thanks!
Since this is tagged as fmdb I assume you work with local database. It is considered good programming practice to keep your data operations in the background, however it shouldn't hurt too much to query the database in the main thread as long as you INSERT or SELECT small amount of data. I'm sure you will be a happier programmer if your move all your data related operations to the background though.
To see how much time your fmdb queries take, you can profile your code using Time Profiler template (XCode 4.2). Then you can decide, if the delays are acceptable, or should the code be moved to the background.