Open ARDInformatique opened 2 years ago
Views are not "built", their plan is merged into the outer query plan and then executed as decided by the optimizer. Nobody says TABLE_A should be read first (and be seen as empty), in fact the optimizer may prefer reading from the tables inside the view.
Ok i'm understand by there is no way form force the first read TABLE_A for not reading unnecessarily the VIEW ?
You can try:
SELECT A.ID FROM TABLE_A A INNER JOIN VIEW_B C ON A.ID=C.ID+0
Request on TABLE_A whith a join on VIEW_B.
I don't understand why Firebird builds VIEW_B because the join is lapsed since TABLE_A is empty
SELECT TABLE_A.ID FROM TABLE_A JOIN VIEW_B C USING (ID)
Do you have an explication ?