Avoid Hard delete in database, suggestion soft delete
AvoidSELECT * FROM ... in query apps. Please define your column.
EX: l = Location.find_by_sql(:conditions => ["SELECT name, website, city FROM locations WHERE id = ? LIMIT 1", id])
Don’tJOIN different schema database.
Column comparison using in JOIN table must be INT or UUID. Make sure the column is default not null.
Handle possible null value in your app.
Avoid function now() and CURRENT_TIMESTAMP() in where clause. Please generate date on the app side. Cause this function is costly if you running in query.
Ordering data except for pagination purpose must be executed in app.
Consult your new queries, indexing table or may be want to get huge data to DBE team
Instead of using OR for filter values in same column, please use IN. ex: where a in (1,2) ; where a=1 or a=2
Every table must has created_at, updated_at, deleted_at and is_deleted. Those columns used for CRUD and also for soft delete .
Maximum 100 data in where clause IN (data 1 - 100)