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

how to stop an sql process

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

    #16
    Re: how to stop an sql process

    Edhy,

    My client is pretty rigid, wants what he wants. I am likely going to use the stored procedure and optimisation methods described in this thread. The full picture is the table is around 300 million records and if the user searches for LastName=wood and gets 500K records, I am to pop a msg saying "Dude narrow your search" and keep doing that until the record count is under 100.
    Steve Wood
    See my profile on IADN

    Comment


      #17
      Re: how to stop an sql process

      Hi Steve,

      Originally posted by Steve Wood View Post
      The full picture is the table is around 300 million records and if the user searches for LastName=wood and gets 500K records, I am to pop a msg saying "Dude narrow your search" and keep doing that until the record count is under 100.
      That is not what I meant, sorry if I gave you the wrong impression.
      All I am trying to do is understand your clients requirements and have a clear picture why anybody would like to see a grid with 500K or 1M records instead of an Excel or CSV file.

      My clients will always ask many things but I tend to ask the reasons why so I can then suggest the best approach based on facts and limitations.
      Edhy Rijo
      Progytech
      (Computer Consultants)
      The makers of CardTracking.Net
      www.progytech.com

      Comment


        #18
        Re: how to stop an sql process

        For sure the grid would only show the first 100 max. I would only want to return the first 100 (or so) in the query. I just meant a simple server side view with a limit is not going to work because the limit would not take the filter in to account. I know how to handle most clients needs but this guy is a bit more insistent (by which I mean he strives to give his users what they need).
        Steve Wood
        See my profile on IADN

        Comment


          #19
          Re: how to stop an sql process

          Originally posted by Steve Wood View Post
          Edhy,

          My client is pretty rigid, wants what he wants. I am likely going to use the stored procedure and optimisation methods described in this thread. The full picture is the table is around 300 million records and if the user searches for LastName=wood and gets 500K records, I am to pop a msg saying "Dude narrow your search" and keep doing that until the record count is under 100.
          this statement is different from the post number 1. may be they are the same to you since you are involved, deal with this everyday and I am not.
          is it possible then to have a dialog and ask the user to search and use the search terms to count the record yield and pop up the message till the list is down to earth from stratosphere then proceed to the grid to display the result?
          thanks for reading

          gandhi

          version 11 3381 - 4096
          mysql backend
          http://www.alphawebprogramming.blogspot.com
          [email protected]
          Skype:[email protected]
          1 914 924 5171

          Comment


            #20
            Re: how to stop an sql process

            Thanks Gandhi,

            The discrepancy is that the first post talks about website users and the most recent talks about my client.

            I agree that I should just do a count based on their search and return a number only, tell them to refine search, etc. I showed my client a product by Omnidex (thanks Al) where returning results (counts, soundex, etc) from large tables is instant.
            Steve Wood
            See my profile on IADN

            Comment


              #21
              Re: how to stop an sql process

              the omnidex demo does exactly what I said.
              you have ton of experience, won't you be able to do something like that with a dialog and onChange events to display the results the same way they did?
              thanks for reading

              gandhi

              version 11 3381 - 4096
              mysql backend
              http://www.alphawebprogramming.blogspot.com
              [email protected]
              Skype:[email protected]
              1 914 924 5171

              Comment


                #22
                Re: how to stop an sql process

                Yes I could duplicate but it would take many minutes to return those counts instead of instant as with the Omni add-on. I have not determined price and how to use with Alpha. I know I would have to use ODBC rather than AlphaDAO.
                Steve Wood
                See my profile on IADN

                Comment


                  #23
                  Re: how to stop an sql process

                  Originally posted by Steve Wood View Post
                  Edhy,

                  My client is pretty rigid, wants what he wants. I am likely going to use the stored procedure and optimisation methods described in this thread. The full picture is the table is around 300 million records and if the user searches for LastName=wood and gets 500K records, I am to pop a msg saying "Dude narrow your search" and keep doing that until the record count is under 100.
                  Set the soundex of of your popup message limit to 5 ! that's smart developing ""

                  Comment


                    #24
                    Re: how to stop an sql process

                    http://www.percona.com/blog/2006/06/...-large-tables/
                    take a look at this article, may be there is something to consider.
                    thanks for reading

                    gandhi

                    version 11 3381 - 4096
                    mysql backend
                    http://www.alphawebprogramming.blogspot.com
                    [email protected]
                    Skype:[email protected]
                    1 914 924 5171

                    Comment


                      #25
                      Re: how to stop an sql process

                      Removed was incorrect.
                      Last edited by chadbrown; 01-08-2015, 10:11 AM.
                      Chad Brown

                      Comment


                        #26
                        Re: how to stop an sql process

                        Steve what about assigning a limit using a variable that the user can set?
                        Use a session variable set on login to say 10000 but have a spot to increase it using a textbox that on change sets a new limit.
                        Chad Brown

                        Comment


                          #27
                          Optimize your sql query for best search result

                          Hi Steve,

                          Regarding the search here is some sample code how to limit the max records say to 100. Then you display a red line message to limit the search. There is no problem when you place a search criteria like: LastName='Wood' since the first 100 records will be displayed. I have done this kind of work with dot net as well 5 years with TB of databases and the standard is to show 100 records every search no matter what.

                          Code:
                          [INDENT][/INDENT]IF @Address IS NULL AND @City IS NULL AND @State IS NULL AND @Zip IS NULL
                                      BEGIN
                                          INSERT INTO SearchResults
                                          SELECT TOP 100
                                              UserID = @UserID , 
                                              Cu.ID,
                                              'Customer' AS SearchType
                                          FROM
                                              Customer Cu
                                          WHERE
                                              (Cu.FirstName LIKE @FirstName + '%' OR @FirstName IS NULL) AND
                                              (Cu.LastName LIKE  @LastName  + '%' OR @LastName IS NULL)  
                                               
                                          SELECT @@ROWCOUNT AS TotalRecs
                                          RETURN     
                                END
                          Regards,

                          Doron
                          The Farber Consulting Group, Inc.

                          Main Web Site: http://www.dFarber.com
                          MS SQL Blog: http://www.dfarber.com/computer-consulting-blog.aspx
                          Convert Ms Access to Web
                          Custom Software Development
                          Alpha Five Development
                          No Interest Loans Application
                          MS SQL Remote DBA
                          Last edited by DoronF; 01-08-2015, 10:52 AM.

                          Comment


                            #28
                            Re: how to stop an sql process

                            If you are experiencing very slow queries in SQL Server using expressions such as LIKE ('contains' and 'starts with' searches), there is a known performance issue in SQL Server if the fields are not unicode (not nvarchar() or nchar()). SQL Server will create a calculated field value for each record in the table using CONVERT_IMPLICIT to use in the query expression, which can be very slow.

                            Alpha Anywhere added an option that will dramatically improve speed, particularly with large tables. This was covered in the "Whats new for Alpha Anyhwere" documentation.

                            http://news.alphasoftware.com/v12pre...seNotesV12.htm

                            Just search for "AlphaDAO - SQL Server - Slow queries "

                            Comment


                              #29
                              Re: how to stop an sql process

                              I will review that document. I happen to be using MySQL and still don't understand why SELECT lastname FROM mytable WHERE lastname LIKE 'wood%' (plus a limit of say 1000), on a 300 million row table takes seconds directly on the sql engine (via Navicat) and 20+ minutes coming from Alpha.
                              Steve Wood
                              See my profile on IADN

                              Comment


                                #30
                                Re: how to stop an sql process

                                Steve, I think Alpha has more to do than Navicat, for example they may be doing a full table scan to get a count of records.

                                So, I'd try this: create a temporary table ( or I've been using memory engine tables lately for situations like this where I need the table for only a short while) and create a stored procedure that truncates the memory table, then inserts the 1000 records from your 300 million table. Now, use that table for the grid. As far as Alpha is concerned, the table only has at most 1000 records that are already sorted and don't need filtering, so it should be fast.
                                Pat Bremkamp
                                MindKicks Consulting

                                Comment

                                Working...
                                X