Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 113827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:45:50+00:00 2026-05-11T02:45:50+00:00

I am running a query against a providex database that we use in MAS

  • 0

I am running a query against a providex database that we use in MAS 90. The query has three tables joined together, and has been slow but not unbearably, taking about 8 minutes per run. The query has a fair number of conditions in the where clause:

I’m going to omit the select part of the query as its long and simple, just a list of fields from the three tables that are to be used in the results.

But the tables and the where clauses in the 8 minute run time version are:

(The first parameter is the lower bound of the user-selected date range, the second is the upper bound.)

FROM  'AR_InvoiceHistoryDetail' 'AR_InvoiceHistoryDetail',  'AR_InvoiceHistoryHeader' 'AR_InvoiceHistoryHeader', 'IM1_InventoryMasterfile'  'IM1_InventoryMasterfile'  WHERE 'AR_InvoiceHistoryDetail'.'InvoiceNo' = 'AR_InvoiceHistoryHeader'.'InvoiceNo'  AND 'AR_InvoiceHistoryDetail'.'ItemCode' = 'IM1_InventoryMasterfile'.'ItemNumber'  AND 'AR_InvoiceHistoryHeader'.'SalespersonNo' = 'SMC'  AND 'AR_InvoiceHistoryHeader'.'OrderDate' >= @p_dr  AND 'AR_InvoiceHistoryHeader'.'OrderDate' <= @p_d2 

However, it turns out that another date field in the same table needs to be the one that the Date Range is compared with. So I changed the Order Dates at the end of the WHERE clause to InvoiceDate. I haven’t had the query run successfully at all yet. And I’ve waited over 40 minutes. I have no control over indexing because this is a MAS 90 database which I don’t believe I can directly change the database characteristics of.

What could cause such a large (at least 5 fold) difference in performance. Is it that OrderDate might have been indexed while InvoiceDate was not? I have tried BETWEEN clauses but it doesn’t seem to work in the providex dialect. I am using the ODBC interface through .NET in my custom report engine. I have been debugging the report and it is running at the database execution point when I asked VS to Break All, at the same spot where the 8 minute report was waiting, so it is almost certainly either something in my query or something in the database that is screwed up.

If its just the case that InvoiceDates aren’t indexed, what else can I do in the providex dialect of SQL to optimize the performance of these queries? Should I change the order of my criteria? This report gets results for a specific salesperson which is why the SMC clause exists. The prior clauses are for the inner joins, and the last clause is for the date range.

I used an identical date range in both the OrderDate and InvoiceDate versions and have ran them all mulitiple times and got the same results.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:45:50+00:00Added an answer on May 11, 2026 at 2:45 am

    I still don’t know exactly why it was so slow, but we had another problem with the results coming from the query (we switched back to using OrderDate). We weren’t getting some of the results because of the nature of the IM1 table.

    So I added a Left Outer Join once I figured out Providex’s syntax for that. And for some reason, even though we still have 3 tables, it runs a lot faster now.

    The new query criteria are:

    FROM  'AR_InvoiceHistoryHeader' 'AR_InvoiceHistoryHeader',  {OJ 'AR_InvoiceHistoryDetail' 'AR_InvoiceHistoryDetail'  LEFT OUTER JOIN 'IM1_InventoryMasterfile' 'IM1_InventoryMasterfile' ON 'AR_InvoiceHistoryDetail'.'ItemCode' =  'IM1_InventoryMasterfile'.'ItemNumber' } WHERE 'AR_InvoiceHistoryDetail'.'InvoiceNo' =  'AR_InvoiceHistoryHeader'.'InvoiceNo' AND  'AR_InvoiceHistoryHeader'.'SalespersonNo' = 'SMC'  AND 'AR_InvoiceHistoryHeader'.'InvoiceDate' >= ?  AND 'AR_InvoiceHistoryHeader'.'InvoiceDate' <= ? 

    Strange, but at least I learned more of the world of Providex Sql in the process.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 62k
  • Answers 62k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Could you perhaps have a dictionary of a struct that… May 11, 2026 at 10:03 am
  • added an answer You can share a socket between two (or more) processes… May 11, 2026 at 10:03 am
  • added an answer Ok, turns out it has been a long time since… May 11, 2026 at 10:03 am

Related Questions

I am running a query against a providex database that we use in MAS
My Server is located in US and I am running a query against it.
I am running oracle and have a query which pulls some results from the
I am running a Tomcat application, and I need to display some time values.
I am running a mysql server. I would like to somehow make sure that
I am running a couple of databases on MySQL 5.0.45 and am trying to
I am running a java program that sets up a database connection to an
I am running a Solr instance on Jetty and when I search using the
I am running a program and want to see what its return code is
I am running a windows machine have installed Python 2.5. I also used the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.