Midazolam is a commonly used drug in gastrointestinal endoscopy due to the good cardiovascular stability and mild respiratory depression for elderly patients. However, there is the concern about the the longer and less predictable recovery or the potential for repeat sedation when the active metabolite becomes bioavailable. Remimazolam Tosilate is an innovative benzodiazepine with better sedation effect and less recovery or resedation issues than midazolam, which possibly make the drug more suitable in elderly patients. We aim to clarify whether remimazolam tosilate is better than midazolam in elderly patients undergoing gastrointestinal endoscopy.