Jump to content

This topic is 7069 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi Guys,

I've been trying to get fx.php working, and everything was fine on my little test database of 50 records.

Now I am trying to test pulling data out of a real database with 5700 records, and for some reason it is ridiculously slow. Over 3 minutes to return the first ten records. Surely that can't be right?

Below is the php code I am using. This definitely works, but I need help to get the speed sorted out.

I doubt it's hardware related (the DB server and the web server are both very grunty machines seperate machines, and they are barely ticking over...), so hopefully I have just produced dodgy code. IWP is very fast.

Thanks in advance

Sean.


<?php

include_once('FX/FX.php');

include_once('FX/FMErrors.php'); 

include_once('FX/server_data.php'); 

set_time_limit(0); 

$instanceName=new FX($serverIP,$webCompanionPort);

$instanceName->setDBData('DBASENAME','LAYOUT','10'); 

$instanceName->SetDBUserPass('USER','PASSWORD'); 

$instanceName->FMSkipRecords('0');

$instanceResult=$instanceName->FMFindall();

?>

<html>

<head>

<title>OEN Assets Listing</title>

</head>

<body>



Error Code: <?php echo $instanceResult['errorCode']; ?> <br>

Found Count: <?php echo $instanceResult['foundCount']; ?> <br><br>

<hr>

<?php

//break delimited

foreach($instanceResult['data'] as $key=>$instanceData)

{

echo "asset_id: ".$instanceData['asset_id'][0]."<br>";

}

?>





</body>

</html>



  

Posted

I think the problem is something on the layout.

Didn't think there was too much on there, but I created a new layout with just the relevant fields on it, and now it's lightning fast again.

Possibly its the fields set up to check for duplicate records via relationships.

Trap for newbies. I didn't realise the layouts elements made such a difference. Guess this means I'll have lots of web layouts.

Thanks :

  • 3 months later...
Posted

I find the first search of the day is slow on my solution as well. Almost like the database needs a coffee before it starts its day...

What most likely happens is the first search sorts the data and updates indexes. After the initial search things usually speed up.

This topic is 7069 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.