Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Report slow to preview - LQO

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Report slow to preview - LQO

    I have a report based on a single table with 40,000+ records using the following complicated filter in the report. It takes 63 seconds to preview.

    Code:
    Location = Var->V_Location .and.  (*word(var->v_shift,shift)).and. (Bgn_Date<=Var->V_BeginDate.and.(End_Date={}.or.End_Date>Var->V_Begindate .or. SERVICE_DATE=var->v_BeginDate)) .and. (*word(Dow,left(cdow(Var->V_Begindate),2)) .or. Service_Date=Var->V_Begindate .OR. (DateTest(MONTH(Var->V_Begindate),Dayofwk,YEAR( Var->V_Begindate),Wkofmo)=Var->V_Begindate .or. RECURDATE (Bgn_Date,Recur,var->v_begindate)- Recur = var->V_Begindate .or. RECURDATE (Bgn_Date,Recur,var->v_begindate) = var->V_Begindate))
    I'm thinking Lightning Quick Optimization (LQO) may help. But I can't get it working. And I don't really understand LQO since it does not filter records. Help for LQO requires the following:

    "Use at least one of the same fields used in the query.

    If you use multiple fields with different data types, the first field used must be type character,

    The data type of the data in the index key must match the data type of the field you are searching.

    Use an order expression that contains either a single field, or two fields concatenated using the plus operator (+), such as in the expression Lname+Fname.

    Not use the Unique Only option

    Not use a filter expression"

    Is LQO for searching records ONLY, or will it help in filtering records?

    I tried using an index of: Location+shift+cdate(Bgn_date) with no luck. I then tried adding a calculated field to the table and using it in the index expression without success, improved speed of report.

    I'm printing the report from a form based on the same table as the report. I've tried off-loading part of the report filter to the form, but without success as it delays opening the form and the purpose of the form is to capture the variables.

    What would you suggest?

    Thanks,

    ~ Tom

  • #2
    Re: Report slow to preview - LQO

    In case it is not clear above, I tried taking the filter off the report and running a query using LQO, then previewing the report; but without success. The report still takes over a minute to display.

    Comment


    • #3
      Re: Report slow to preview - LQO

      divide and conquer.

      Split the query into parts

      One step at a time until you find what part is slowing it down.
      Al Buchholz
      Bookwood Systems, LTD
      Weekly QReportBuilder Webinars Thursday 1 pm CST

      Occam's Razor - KISS
      Normalize till it hurts - De-normalize till it works.
      Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
      When we triage a problem it is much easier to read sample systems than to read a mind.
      "Make it as simple as possible, but not simpler."
      Albert Einstein

      http://www.iadn.com/images/media/iadn_member.png

      Comment


      • #4
        Re: Report slow to preview - LQO

        Would you be better off with a calculated field in the table which sets part of the query value to search on when saved?
        See our Hybrid Option here;
        https://hybridapps.example-software.com/


        There are 3 things you can do in any situation;
        Live with it, Change it or Walk away from it.

        Comment


        • #5
          Re: Report slow to preview - LQO

          Ted - I tried that, but without success.

          Al - you got me going on the right track. I found the problem expression in the filter that slows everything down.

          I'm down to about 10-15 seconds now to show print preview. That might be good-enuf.

          Actually it a whole lot better.

          Thanks Again,

          ~ Tom

          Comment


          • #6
            Re: Report slow to preview - LQO

            Hi Tom,

            Just to show that there are several ways to skin a cat, I just ran into this problem.
            The query I have wasn't anywhere near as complicated as yours, yet the report was taking
            an awful long time to provide results (my table has over 400000 rows).
            My solution was to create a table for report data.
            Insert data from the Main table to the report data table using the desired filter,
            then run the report against the report data table.

            In my situation, it took the processing time down to less than 3 seconds.

            Hope this helps.

            Gregg
            Gregg
            https://paiza.io is a great site to test and share sql code

            Comment


            • #7
              Re: Report slow to preview - LQO

              Originally posted by madtowng View Post
              Hi Tom,

              Just to show that there are several ways to skin a cat, I just ran into this problem.
              The query I have wasn't anywhere near as complicated as yours, yet the report was taking
              an awful long time to provide results (my table has over 400000 rows).
              My solution was to create a table for report data.
              Insert data from the Main table to the report data table using the desired filter,
              then run the report against the report data table.

              In my situation, it took the processing time down to less than 3 seconds.

              Hope this helps.

              Gregg
              Gregg

              Thanks for the feedback. Good idea for a single user system.

              Is yours a single or multi user system?

              How did you place the data into the report data table?
              Al Buchholz
              Bookwood Systems, LTD
              Weekly QReportBuilder Webinars Thursday 1 pm CST

              Occam's Razor - KISS
              Normalize till it hurts - De-normalize till it works.
              Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
              When we triage a problem it is much easier to read sample systems than to read a mind.
              "Make it as simple as possible, but not simpler."
              Albert Einstein

              http://www.iadn.com/images/media/iadn_member.png

              Comment


              • #8
                Re: Report slow to preview - LQO

                I use the temp table idea for a different purpose, but real fast if done right. based on 950000 records and shadowed for 40 users.
                Dave Mason
                [email protected]
                Skype is dave.mason46

                Comment


                • #9
                  Re: Report slow to preview - LQO

                  It's a multi-user system but because my example is with invoicing, only one person uses it at a time.
                  I setup the alternate table to have every column referenced by the query.
                  Then it's as simple as
                  Code:
                   
                  insert into <alt-table>
                  
                  select this,that,otherThing
                  from <master Table>
                  where something = somethingElse
                  Gregg
                  https://paiza.io is a great site to test and share sql code

                  Comment


                  • #10
                    Re: Report slow to preview - LQO

                    @Al
                    If a temp table is used for a multiple user scenario, would you create the table on the local workstation?
                    Robin

                    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                    Comment


                    • #11
                      Re: Report slow to preview - LQO

                      Originally posted by MoGrace View Post
                      @Al
                      If a temp table is used for a multiple user scenario, would you create the table on the local workstation?
                      1. I'd have the report based on a set even if the set is one table.

                      2. Then I'd build the temp table with a function that uses <tbl>.duplicate to duplicate a source table in the workspace of the format needed.

                      3. Then I'd copy the appropriate records form the table/set into the temp table.

                      Code sample to build a function from.

                      Code:
                      dim mytbl as P
                      dim mytblnew as P
                      dim mydir as C
                      dim mynewtblname as C
                      
                      mytbl=table.open("report1")
                      
                      mydir=win_special_folder("MyDocuments") ' or some other unique directory for the user.
                      mynewtblname=mydir+chr(92)+"report2.dbf"
                      
                      FILE_Drop_From_DB(mynewtblname)
                      
                      mytbl.duplicate(mynewtblname,0) ' choose the appropriate flag for your needs (1-13)- see documentation
                      
                      FILE_ADD_TO_DB(mynewtblname)
                      
                      mytbl.close()
                      Al Buchholz
                      Bookwood Systems, LTD
                      Weekly QReportBuilder Webinars Thursday 1 pm CST

                      Occam's Razor - KISS
                      Normalize till it hurts - De-normalize till it works.
                      Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                      When we triage a problem it is much easier to read sample systems than to read a mind.
                      "Make it as simple as possible, but not simpler."
                      Albert Einstein

                      http://www.iadn.com/images/media/iadn_member.png

                      Comment

                      Working...
                      X