Skip to Content
author's profile photo Former Member
Former Member

Is SQL faster than SE11?

Hi guys,

i have a problem on using se11. Since the data in my table is more than 1 millard, when I use se11 or se16 to check how many data there is, it takes so long. Will it be faster if I user SQL Statement with ABAP

like

select max ()

from ...

If not, how can I get the information (how many data there is and so on)as quickly as possible?

Thanks for any hint!

Regards,

Liying

Add a comment
10|10000 characters needed characters exceeded

Related questions

7 Answers

  • Best Answer
    Posted on Aug 28, 2007 at 02:38 PM

    yes of course, the statement is o.k., but the trick (the improvement) will not work.

    Siegfried

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Thomas Zloch

      Hi Thomas,

      We are dealing with PP and load data to BI. Since our data requieres starting point, and have to be calculated based on arbitary point. These calculation leads to amount of data records.

      I have no permission to execute transaction DB20. Thanks though.

      Regards,

  • Posted on Aug 28, 2007 at 07:14 AM

    Hi,

    the trick with the up to 1 rows plus order by will not work, because the order by must be processed first, and then there is any way only one record coming back.

    Check data archiving, one billion records is anyway extremely large for a table, usual large table have 1 to 10 million records.

    Siegfried

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 27, 2007 at 09:53 AM

    If there are millions of records , then write one SQL in a program and schedule that program in background and check the spool to check the no of records

    select count(*) from ztablw.
    write : "No of Records :" , sy-dbcnt.

    value of sy-dbcnt can be seen in spool output

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 27, 2007 at 10:47 AM

    How many records do you have in your table, 1.000.000 or 1.000.000.000????

    The maximum works in the same way as said, use max(field) instead of count(*).

    There is no way to get the maximum by SE11 or SE16.

    Siegfried

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 27, 2007 at 01:15 PM

    If you need the max value for all table entries, there's no way to speed it up except maybe creating an index on that column (depending on it's type and amount of possible values, that may help or not). How many possible values does that column have? If it's a date field, an index may help, if it's a gender field (M/F), there's no use in creating it.

    Otherwise, it will always be a full table scan (which has a big performance cost).

    regards

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 27, 2007 at 12:56 PM

    in principle there is not better solution, 10e+9 (one billion) is extremely large.

    Question: How important is your query in relation to other queries and changes going on on this tables. Tables become obviously only that large if there are a lot of inserts. The inserts are probably much more important than your query.

    If not, then you could create an index with your field as first column.

    And you need to know a reasonably large start-point.

    select max (field) from table

    where field > field_0.

    could work faster. But you must be aware that the index costs database size and performance (inserts are slower). If your query is exeuted onyl once in a while, then it is better not to optimize it.

    Check where data archiving is not the much better option!

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Siegfried,

      the solution about "index" can not be used since it causes the performance problem during "Insert", as you said.

      So from your opinion, it is not possible to improve it, isn't it?

      Regards,

      Liying

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2007 at 09:27 AM

    write select query and process it in background

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.