DBLAYOUT
|
| Posted: 07/05/2003, 10:57 AM |
|
I have a page that has the search & results on the same page. I am searching an Access database that has 491,279 records in it & each record has 10 fields. I am hiding the results grid initially so that no initial query should take place. My search critera consists of a drop down of zip codes (this drop down is created from another table of only zip codes & that table has 167 records and it has a unique key. Another search criter field is another drop down from another table that has only 17 records in it. When my screen first opens, or is trying to open, it takes 30 seconds for this window to appear. When I do a search, it returns the results in under 5 seconds. Any idea on why the initial screen takes soooooo long to load?
Thanks
Chris
|
|
|
 |
Dblayout
|
| Posted: 07/05/2003, 11:43 AM |
|
After a little more research, I think the search window is doing an initial query for some reason. I have the grids Visable property set to False & it doesn't display. If I make my SQL very restrictive to only return a fe results, the initial screen displays faster. If my SQL is more gneral to allow for more results, the initial screen display is very long. So, the question is how do I make sure NO query is performed until the user press's the Search button?
|
|
|
 |
Headhunter
|
| Posted: 07/05/2003, 2:22 PM |
|
Hello,
The delay is probably a problem of indexes on some tables of your database. I think the problem is with 1 or more joined tables in your search form (the drop down's). Try adding an index on the table "id" where you have a join.
|
|
|
 |
dblayout
|
| Posted: 07/05/2003, 2:52 PM |
|
I have no joins. All 3 tables are stand-alone tables. The 'zip code' table and the 'Type' table were created just for the drop-downs on the search page.
Chris
|
|
|
 |
Headhunter
|
| Posted: 07/05/2003, 3:01 PM |
|
Try to isolate the problem. Delete some items on the search record, or your grid.
Maybe the problem is not your search record form but some joins in your grid?
|
|
|
 |
dblayout
|
| Posted: 07/05/2003, 9:43 PM |
|
I have no joins in the sql. I know it is doing a query when the screen 1st opens becauseit is pulling in all 400,000+ records. Why does CCS even perform like this? Why does it automaticly run the query when the screen is first opened instead of only when the Search button is pressed? I am not sure what I could eliminate besides the grid - but then that would eliminate the query. I have tried setting the Grid.Visable to False but that does not work, the query is still running.
Any ideas?
|
|
|
 |
RonB
|
| Posted: 07/06/2003, 3:50 AM |
|
In the result grid set default values for the parameters. Set them to an impossible value so the result set comes up empty when no parameter is send through the search action. This will result in an empty result set when no search parameters where provided(ie when first opening the page) and should speed up things considerably.
Ron
|
|
|
 |
dblayout
|
| Posted: 07/06/2003, 12:35 PM |
|
That corrects 1 problem but creates a new one. I add a defaylt value of "xxxx" for my Zip Code so that I know nothing will be found. The initial screens open quickly now. But, now my code that is checking the 'Where' clause of the SQL to hide the grid upon initial entry failes because there is a default value. Wow, I think my head is spinning from being so confused. Now how do I know when to set the Grid to Visable=False so it doesn't show up upon initial entry? Also, just as a side note, even if the Grid is not visable, the SQL is still executed. I was under the impression that if the Grid was not visable, the SQL or query would not execute. Did I miss something here also?
Thanks for any help.
|
|
|
 |
rrodgers
|
| Posted: 07/07/2003, 6:31 AM |
|
>>Now how do I know when to set the Grid to
>>Visable=False so it doesn't show up upon initial entry?
If SearchField = "" Or SearchField = "xxxx" Then
Grid.Visible = False
End if
Rob
|
|
|
 |
Ashiff
|
| Posted: 07/07/2003, 5:17 PM |
|
I have a very simple solution for you.
Copy the page say car.ccp to car1.ccp. In the header reference it to car.ccp. Delete grid from car.ccp. In the search button properties refer it to car1.ccp.
NOw when the page loads there is no grid and so it will be fast. Then if search button is pressed the result page is got from car1.ccp and it will be faster too.
|
|
|
 |