oleksiy-sayankin commented on pull request #2323:
URL: https://github.com/apache/hive/pull/2323#issuecomment-849617289


    **MySQL**
    
   MySQL does support limit. See 
[here](https://www.mysqltutorial.org/mysql-limit.aspx)
   
   > SELECT 
   >     select_list
   > FROM
   >    table_name
   > LIMIT [offset,] row_count;
   
   **MS SQL**
   
   Does not support limit. See 
[here](https://stackoverflow.com/questions/603724/how-to-implement-limit-with-sql-server).
 There is an alternative
   
   > SELECT TOP 10 * FROM (SELECT TOP 20 FROM Table ORDER BY Id) ORDER BY Id 
DESC
   
   **ORACLE**
   
   Does not support limits. See 
[here](https://stackoverflow.com/questions/470542/how-do-i-limit-the-number-of-rows-returned-by-an-oracle-query-after-ordering).
 There is an alternative:
   
   > SELECT * 
   > FROM   sometable
   > ORDER BY name
   > OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY
   
   So I can re-fix this way:
   
           if (dbProduct.isPOSTGRES() || dbProduct.isMYSQL()) {
           // use limit clause here
           }
   
   to make it work faster on MySQL.
   
   
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to