Home > Implement > Discussions

SAP HANA Resources

Discover solutions powered by SAP HANA that can fast track your implementation. Implement SAP HANA technologies for building the extraordinary.

2 Replies Latest reply: Mar 8, 2013 12:36 AM by Raj Kumar Salla RSS

faster alternative to where clause in SQL

Rajarshi Muhuri Newbie
Currently Being Moderated

Analytical Views have constraint filters that filter data before pulling the data up , The same happens with input parameters ( place holders) that filter data before pulling the data up in a calculation view. 

 

Select A, B , C from tableA where A='constant' does the same function except its filters the data after its fetched , so its inefficient .

 

What is the SQL statement ( or CE script statement ) that places filters before pulling the data .

 

Rishi

 

PS : I am joining a 50 million row with a 70 million record table , thus joining chucks of the table at a time , using a stored proc that loops over periods . Thus need an equivalent SQL statement that pushes the filters deep into the Data base , so that the records are filtered before being fetched. 

 

  • Re: faster alternative to where clause in SQL
    Newbie
    Currently Being Moderated

    Hi,

     

    As per my understanding of following statement ,

     

    Select A, B , C from tableA where A='constant' does the same function except its filters the data after its fetched , so its inefficient .

     

    It applies filter in the database and return only relevant (filtered) rows all operations done in DB.

     

    In your scenario, you can write SQL to filter records based on the time period and then assign in to table variable types and then use CE_JOIN , CE_UNION_ALL CE functions to logically join filtered records from multiple tables.

     

    Hope that helps.

     

    Regards

    Nimesh Kapadia

  • Re: faster alternative to where clause in SQL
    Raj Kumar Salla Newbie
    Currently Being Moderated

    Hi Rishi,

     

    Its always better to use CE functions.

    Try

    out = CE_PROJECTION(TABLEA,["A","B","C"],'A='constant'');

    In case of syntax error, keep the expression in single quote '' for A=constant.

     

    Regards

    Raj

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points

Contact Us

SAP Experts are here to help.

Ask SAP HANA

Our website has a rich support section designed to help you get the highest quality answers quickly and easily. Please take a look at the options below to get you answers from the SAP experts.

If you have technical questions:

If you're looking for training materials or have training questions:

If you have certification questions:

Χ