Closed chenboy closed 6 years ago
Thanks! Let's have @malin1993ml review this.
I'll review this after I get back to hotel.
@malin1993ml @GustavoAngulo Since @chenboy is now at Snowflake, I think that you guys will need to take care of this. Can you fix it by next week. We are going to need this for TPC-C (AFAIK)
Oh, I nearly forgot this, sorry. I'll address comments & fix the code tonight.
Thanks a lot, Bowei!
On Thu, Jun 21, 2018 at 11:49 AM, Bowei Chen notifications@github.com wrote:
Oh, I nearly forgot this, sorry. I'll address comments & fix the code tonight.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cmu-db/peloton/pull/1385#issuecomment-399206129, or mute the thread https://github.com/notifications/unsubscribe-auth/AFojzUgsexj-YjMN8X4cbC3s2D3dRCalks5t--rSgaJpZM4UPLdL .
@malin1993ml Jenkins has been wonky lately. Restarting fixed it.
This PR applies limit + sort optimization in the optimizer as the same way
ORCA
does it. Basically, we keep an internal order inLimit
operator when the parse tree contains both limit and order, and the optimizer logic is tweaked a bit to consider this internal sort. When the plan is generated, the limit operator will generate aLimitPlan
on top of anOrderByPlan
with limit and offset set correctly.The multiple test cases in
optimizer_sql_test.cpp
already tested order by with limit, so I didn't add new ones.