RE: [PHP] Re: dbase_get_record_with_names; Very slow search!!!

2009-11-30 Thread Bob McConnell
From: news

 even though the dbf has 10K records
 Fox can't spend minutes to found a match
 by the way, its very strange
 to have 35 columns in a table/dbf or whatever
 
 pay attention to the comment of Ashley
 in Fox, you should:
 
 SELECT directory
 INDEX on phone_number to idx_directory_phone
 - or -
 INDEX on phone_number tag phone of cdx_directory
 
 i worked with Fox
 with dbfs of 2 millions of records
 and the speed is amazing -- using indexes of course!

It has been a long time since I worked with either FoxPro or dBase, but
IIRC, both required you to explicitly create any indexes they might
need. They don't have query analyzers like Postgres, MySQL and other
modern DBMS engines.

Bob McConnell

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: dbase_get_record_with_names; Very slow search!!!

2009-11-30 Thread Hernán

of course, i agree
xbase needed indexes to work properly


Bob McConnell escribió:

From: news

  

even though the dbf has 10K records
Fox can't spend minutes to found a match
by the way, its very strange
to have 35 columns in a table/dbf or whatever

pay attention to the comment of Ashley
in Fox, you should:

SELECT directory
INDEX on phone_number to idx_directory_phone
- or -
INDEX on phone_number tag phone of cdx_directory

i worked with Fox
with dbfs of 2 millions of records
and the speed is amazing -- using indexes of course!



It has been a long time since I worked with either FoxPro or dBase, but
IIRC, both required you to explicitly create any indexes they might
need. They don't have query analyzers like Postgres, MySQL and other
modern DBMS engines.

Bob McConnell

  




---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091130-0, 30/11/2009
Tested on: 30/11/2009 01:17:03 p.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com




Re: [PHP] Re: dbase_get_record_with_names; Very slow search!!!

2009-11-30 Thread Rahul S. Johari


On Nov 30, 2009, at 11:07 AM, Bob McConnell wrote:


From: news


even though the dbf has 10K records
Fox can't spend minutes to found a match
by the way, its very strange
to have 35 columns in a table/dbf or whatever

pay attention to the comment of Ashley
in Fox, you should:

SELECT directory
INDEX on phone_number to idx_directory_phone
- or -
INDEX on phone_number tag phone of cdx_directory

i worked with Fox
with dbfs of 2 millions of records
and the speed is amazing -- using indexes of course!


It has been a long time since I worked with either FoxPro or dBase,  
but

IIRC, both required you to explicitly create any indexes they might
need. They don't have query analyzers like Postgres, MySQL and other
modern DBMS engines.

Bob McConnell


That is correct! But in my case - I DO indeed have Indexes created  
manually. FoxPro created .CDX files for Indexes. The problem is - does  
PHP use those indexes?


---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.

[Email] sleepwal...@rahulsjohari.com
[Web]   http://www.rahulsjohari.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: dbase_get_record_with_names; Very slow search!!!

2009-11-30 Thread Rahul S. Johari


On Nov 30, 2009, at 11:41 AM, Bob McConnell wrote:


From: Rahul S. Johari


On Nov 30, 2009, at 11:07 AM, Bob McConnell wrote:


From: news


even though the dbf has 10K records
Fox can't spend minutes to found a match
by the way, its very strange
to have 35 columns in a table/dbf or whatever

pay attention to the comment of Ashley
in Fox, you should:

SELECT directory
INDEX on phone_number to idx_directory_phone
- or -
INDEX on phone_number tag phone of cdx_directory

i worked with Fox
with dbfs of 2 millions of records
and the speed is amazing -- using indexes of course!


It has been a long time since I worked with either FoxPro or dBase,
but
IIRC, both required you to explicitly create any indexes they might
need. They don't have query analyzers like Postgres, MySQL and other
modern DBMS engines.

Bob McConnell


That is correct! But in my case - I DO indeed have Indexes created
manually. FoxPro created .CDX files for Indexes. The problem is -  
does



PHP use those indexes?


And the secondary question is whether you have enough memory to
'permanently' cache those indexes? They don't improve performance very
much unless they are kept in local memory all the time. The only way  
to

fix this is to move to a real DBMS engine.

Bob McConnell




Well that might be a problem. The indexes, along with the files, are  
stored on the network and they are accessed over the network, not  
locally. Although to be fair; I have tried using a copy of the DBF   
it's Index File (CDX) locally and it didn't make any difference to the  
search.


Either way, it all points in the same direction ... using a modern  
DBMS. It's just a problem on our end because all our customer data is  
in FoxPro databases and all the other applications are written for  
those FoxPro databases.


---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.

[Email] sleepwal...@rahulsjohari.com
[Web]   http://www.rahulsjohari.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: dbase_get_record_with_names; Very slow search!!!

2009-11-24 Thread keyser soze

even though the dbf has 10K records
Fox can't spend minutes to found a match
by the way, its very strange
to have 35 columns in a table/dbf or whatever

pay attention to the comment of Ashley
in Fox, you should:

SELECT directory
INDEX on phone_number to idx_directory_phone
- or -
INDEX on phone_number tag phone of cdx_directory

i worked with Fox
with dbfs of 2 millions of records
and the speed is amazing -- using indexes of course!

regards,
ks





Rahul S. Johari escribió:

Ave,

I'm connecting to a foxpro database (dbase) and simply running a search 
to retrieve a record. It's a very simple code.
The problem is, as the database is growing, the search is becoming 
ridiculously slow ... and I mean it's taking minutes. When the dbase 
had 10,000 records ... search was fast  efficient ... as if you were 
connecting to a mySQL Database. Now that the database has over 75,000 
records and still growing ... it's taking minutes to search.


The database has about 35 fields; Search is based on a phone number.
This is the code ...

?php
#Open DBF
$db = dbase_open(dbase.dbf, 0);
   
#PULL UP RECORD

if ($db) {
  $record_numbers = dbase_numrecords($db);
  for ($i = 1; $i = $record_numbers; $i++) {
 $row = dbase_get_record_with_names($db, $i);
 if ($row['PHONE'] == $_POST['PHONE']) {
   
#Retrieve row  display fields
echo $row['STUFF'];   
}   
}

}
?

It works ... but it's getting way too slow.

One thing with FoxPro DBF's is that they use an Index file for searches 
within FoxPro. These are .CDX files which contain the Index. You can 
create an Index on, for example, PHONE field. However I don't think 
there's any way in PHP to reference this Index file for faster searches.


Is there any possibility to improve search response time?

Thanks!

---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.

[Email]sleepwal...@rahulsjohari.com
[Web]http://www.rahulsjohari.com








---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091124-0, 24/11/2009
Tested on: 24/11/2009 11:16:25 a.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: dbase_get_record_with_names; Very slow search!!!

2009-11-24 Thread Rahul S. Johari
Your post definitely gives me hope. It's possible I'm doing something  
wrong!
I definitely have the foxpro database indexed. I use this FoxPro  
command ...


INDEX ON PHONE TAG PHONE

I do have a .CDX file present for the Database and if I MODIFY  
STRUCTURE and I can see the INDEX present on PHONE.


Did you check my Code? Is there any other way to pull records off a  
FoxPro Database? Can you use SQL Commands via PHP on FoxPro databases  
(SELECT * FROM  ) ?


Thanks



On Nov 24, 2009, at 9:16 AM, keyser soze wrote:


even though the dbf has 10K records
Fox can't spend minutes to found a match
by the way, its very strange
to have 35 columns in a table/dbf or whatever

pay attention to the comment of Ashley
in Fox, you should:

SELECT directory
INDEX on phone_number to idx_directory_phone
- or -
INDEX on phone_number tag phone of cdx_directory

i worked with Fox
with dbfs of 2 millions of records
and the speed is amazing -- using indexes of course!

regards,
ks





Rahul S. Johari escribió:

Ave,
I'm connecting to a foxpro database (dbase) and simply running a  
search to retrieve a record. It's a very simple code.
The problem is, as the database is growing, the search is becoming  
ridiculously slow ... and I mean it's taking minutes. When the  
dbase had 10,000 records ... search was fast  efficient ... as if  
you were connecting to a mySQL Database. Now that the database has  
over 75,000 records and still growing ... it's taking minutes to  
search.

The database has about 35 fields; Search is based on a phone number.
This is the code ...
?php
   #Open DBF
   $db = dbase_open(dbase.dbf, 0);
  #PULL UP RECORD
   if ($db) {
 $record_numbers = dbase_numrecords($db);
 for ($i = 1; $i = $record_numbers; $i++) {
$row = dbase_get_record_with_names($db, $i);
if ($row['PHONE'] == $_POST['PHONE']) {
  #Retrieve row  display fields
   echo $row['STUFF'];   }   }
}
?
It works ... but it's getting way too slow.
One thing with FoxPro DBF's is that they use an Index file for  
searches within FoxPro. These are .CDX files which contain the  
Index. You can create an Index on, for example, PHONE field.  
However I don't think there's any way in PHP to reference this  
Index file for faster searches.

Is there any possibility to improve search response time?
Thanks!
---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.
[Email]sleepwal...@rahulsjohari.com
[Web]http://www.rahulsjohari.com



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091124-0, 24/11/2009
Tested on: 24/11/2009 11:16:25 a.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.

[Email] sleepwal...@rahulsjohari.com
[Web]   http://www.rahulsjohari.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: dbase_get_record_with_names; Very slow search!!!

2009-11-24 Thread keyser soze

i will try to help you
but think i'm old in Fox but new in php
and sadly never used php+fox

so, reading your code
i see you are scanning the whole dbf file from php
Fox cant help you in this way

if there is not another option for scan a dbf
the row by row method is very slow




Rahul S. Johari escribió:
Your post definitely gives me hope. It's possible I'm doing something 
wrong!
I definitely have the foxpro database indexed. I use this FoxPro command 
...


INDEX ON PHONE TAG PHONE

I do have a .CDX file present for the Database and if I MODIFY STRUCTURE 
and I can see the INDEX present on PHONE.


Did you check my Code? Is there any other way to pull records off a 
FoxPro Database? Can you use SQL Commands via PHP on FoxPro databases 
(SELECT * FROM  ) ?


Thanks



On Nov 24, 2009, at 9:16 AM, keyser soze wrote:


even though the dbf has 10K records
Fox can't spend minutes to found a match
by the way, its very strange
to have 35 columns in a table/dbf or whatever

pay attention to the comment of Ashley
in Fox, you should:

SELECT directory
INDEX on phone_number to idx_directory_phone
- or -
INDEX on phone_number tag phone of cdx_directory

i worked with Fox
with dbfs of 2 millions of records
and the speed is amazing -- using indexes of course!

regards,
ks





Rahul S. Johari escribió:

Ave,
I'm connecting to a foxpro database (dbase) and simply running a 
search to retrieve a record. It's a very simple code.
The problem is, as the database is growing, the search is becoming 
ridiculously slow ... and I mean it's taking minutes. When the 
dbase had 10,000 records ... search was fast  efficient ... as if 
you were connecting to a mySQL Database. Now that the database has 
over 75,000 records and still growing ... it's taking minutes to search.

The database has about 35 fields; Search is based on a phone number.
This is the code ...
?php
   #Open DBF
   $db = dbase_open(dbase.dbf, 0);
  #PULL UP RECORD
   if ($db) {
 $record_numbers = dbase_numrecords($db);
 for ($i = 1; $i = $record_numbers; $i++) {
$row = dbase_get_record_with_names($db, $i);
if ($row['PHONE'] == $_POST['PHONE']) {
  #Retrieve row  display fields
   echo $row['STUFF'];   }   }
}
?
It works ... but it's getting way too slow.
One thing with FoxPro DBF's is that they use an Index file for 
searches within FoxPro. These are .CDX files which contain the Index. 
You can create an Index on, for example, PHONE field. However I don't 
think there's any way in PHP to reference this Index file for faster 
searches.

Is there any possibility to improve search response time?
Thanks!
---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.
[Email]sleepwal...@rahulsjohari.com
[Web]http://www.rahulsjohari.com



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091124-0, 24/11/2009
Tested on: 24/11/2009 11:16:25 a.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.

[Email]sleepwal...@rahulsjohari.com
[Web]http://www.rahulsjohari.com








---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091124-0, 24/11/2009
Tested on: 24/11/2009 11:55:50 a.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: dbase_get_record_with_names; Very slow search!!!

2009-11-24 Thread keyser soze

Rahul, my friend
i found this in a first search
perhaps it be helpful

http://www.yinfor.com/blog/archives/2008/01/php_connect_dbf_file.html



Rahul S. Johari escribió:
I do believe that what I'm doing is scanning the foxpro dbase row by row 
to get the match ... which is why it's returning the results very slow.


But I don't know if there's any other way to do this. Basically the 
FoxPro DBF has 75,000 records and I have to search for the one row which 
has the Phone number I'm looking for, and display results. If there's 
any other way to do this ... I'll be more then happy to try.



On Nov 24, 2009, at 9:55 AM, keyser soze wrote:


i will try to help you
but think i'm old in Fox but new in php
and sadly never used php+fox

so, reading your code
i see you are scanning the whole dbf file from php
Fox cant help you in this way

if there is not another option for scan a dbf
the row by row method is very slow




Rahul S. Johari escribió:
Your post definitely gives me hope. It's possible I'm doing something 
wrong!
I definitely have the foxpro database indexed. I use this FoxPro 
command ...

INDEX ON PHONE TAG PHONE
I do have a .CDX file present for the Database and if I MODIFY 
STRUCTURE and I can see the INDEX present on PHONE.
Did you check my Code? Is there any other way to pull records off a 
FoxPro Database? Can you use SQL Commands via PHP on FoxPro databases 
(SELECT * FROM  ) ?

Thanks
On Nov 24, 2009, at 9:16 AM, keyser soze wrote:

even though the dbf has 10K records
Fox can't spend minutes to found a match
by the way, its very strange
to have 35 columns in a table/dbf or whatever

pay attention to the comment of Ashley
in Fox, you should:

SELECT directory
INDEX on phone_number to idx_directory_phone
- or -
INDEX on phone_number tag phone of cdx_directory

i worked with Fox
with dbfs of 2 millions of records
and the speed is amazing -- using indexes of course!

regards,
ks





Rahul S. Johari escribió:

Ave,
I'm connecting to a foxpro database (dbase) and simply running a 
search to retrieve a record. It's a very simple code.
The problem is, as the database is growing, the search is becoming 
ridiculously slow ... and I mean it's taking minutes. When the 
dbase had 10,000 records ... search was fast  efficient ... as if 
you were connecting to a mySQL Database. Now that the database has 
over 75,000 records and still growing ... it's taking minutes to 
search.

The database has about 35 fields; Search is based on a phone number.
This is the code ...
?php
  #Open DBF
  $db = dbase_open(dbase.dbf, 0);
 #PULL UP RECORD
  if ($db) {
$record_numbers = dbase_numrecords($db);
for ($i = 1; $i = $record_numbers; $i++) {
   $row = dbase_get_record_with_names($db, $i);
   if ($row['PHONE'] == $_POST['PHONE']) {
 #Retrieve row  display fields
  echo $row['STUFF'];   }   }
}
?
It works ... but it's getting way too slow.
One thing with FoxPro DBF's is that they use an Index file for 
searches within FoxPro. These are .CDX files which contain the 
Index. You can create an Index on, for example, PHONE field. 
However I don't think there's any way in PHP to reference this 
Index file for faster searches.

Is there any possibility to improve search response time?
Thanks!
---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.
[Email]sleepwal...@rahulsjohari.com
[Web]http://www.rahulsjohari.com



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091124-0, 24/11/2009
Tested on: 24/11/2009 11:16:25 a.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.
[Email]sleepwal...@rahulsjohari.com
[Web]http://www.rahulsjohari.com



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091124-0, 24/11/2009
Tested on: 24/11/2009 11:55:50 a.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.

[Email]sleepwal...@rahulsjohari.com
[Web]http://www.rahulsjohari.com








---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091124-0, 24/11/2009
Tested on: 24/11/2009 12:11:02 p.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: dbase_get_record_with_names; Very slow search!!!

2009-11-24 Thread Rahul S. Johari
I do believe that what I'm doing is scanning the foxpro dbase row by  
row to get the match ... which is why it's returning the results very  
slow.


But I don't know if there's any other way to do this. Basically the  
FoxPro DBF has 75,000 records and I have to search for the one row  
which has the Phone number I'm looking for, and display results. If  
there's any other way to do this ... I'll be more then happy to try.



On Nov 24, 2009, at 9:55 AM, keyser soze wrote:


i will try to help you
but think i'm old in Fox but new in php
and sadly never used php+fox

so, reading your code
i see you are scanning the whole dbf file from php
Fox cant help you in this way

if there is not another option for scan a dbf
the row by row method is very slow




Rahul S. Johari escribió:
Your post definitely gives me hope. It's possible I'm doing  
something wrong!
I definitely have the foxpro database indexed. I use this FoxPro  
command ...

INDEX ON PHONE TAG PHONE
I do have a .CDX file present for the Database and if I MODIFY  
STRUCTURE and I can see the INDEX present on PHONE.
Did you check my Code? Is there any other way to pull records off a  
FoxPro Database? Can you use SQL Commands via PHP on FoxPro  
databases (SELECT * FROM  ) ?

Thanks
On Nov 24, 2009, at 9:16 AM, keyser soze wrote:

even though the dbf has 10K records
Fox can't spend minutes to found a match
by the way, its very strange
to have 35 columns in a table/dbf or whatever

pay attention to the comment of Ashley
in Fox, you should:

SELECT directory
INDEX on phone_number to idx_directory_phone
- or -
INDEX on phone_number tag phone of cdx_directory

i worked with Fox
with dbfs of 2 millions of records
and the speed is amazing -- using indexes of course!

regards,
ks





Rahul S. Johari escribió:

Ave,
I'm connecting to a foxpro database (dbase) and simply running a  
search to retrieve a record. It's a very simple code.
The problem is, as the database is growing, the search is  
becoming ridiculously slow ... and I mean it's taking minutes.  
When the dbase had 10,000 records ... search was fast   
efficient ... as if you were connecting to a mySQL Database. Now  
that the database has over 75,000 records and still growing ...  
it's taking minutes to search.
The database has about 35 fields; Search is based on a phone  
number.

This is the code ...
?php
  #Open DBF
  $db = dbase_open(dbase.dbf, 0);
 #PULL UP RECORD
  if ($db) {
$record_numbers = dbase_numrecords($db);
for ($i = 1; $i = $record_numbers; $i++) {
   $row = dbase_get_record_with_names($db, $i);
   if ($row['PHONE'] == $_POST['PHONE']) {
 #Retrieve row  display fields
  echo $row['STUFF'];   }   }
}
?
It works ... but it's getting way too slow.
One thing with FoxPro DBF's is that they use an Index file for  
searches within FoxPro. These are .CDX files which contain the  
Index. You can create an Index on, for example, PHONE field.  
However I don't think there's any way in PHP to reference this  
Index file for faster searches.

Is there any possibility to improve search response time?
Thanks!
---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.
[Email]sleepwal...@rahulsjohari.com
[Web]http://www.rahulsjohari.com



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091124-0, 24/11/2009
Tested on: 24/11/2009 11:16:25 a.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.
[Email]sleepwal...@rahulsjohari.com
[Web]http://www.rahulsjohari.com



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091124-0, 24/11/2009
Tested on: 24/11/2009 11:55:50 a.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.

[Email] sleepwal...@rahulsjohari.com
[Web]   http://www.rahulsjohari.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: dbase_get_record_with_names; Very slow search!!!

2009-11-24 Thread Rahul S. Johari

Keyser,

It gets better -- I'm on a Mac OS X (Leopard)!! As far as I know,  
there isn't a VisualFoxPro ODBC Driver for Mac OS X.




On Nov 24, 2009, at 10:11 AM, keyser soze wrote:


Rahul, my friend
i found this in a first search
perhaps it be helpful

http://www.yinfor.com/blog/archives/2008/01/php_connect_dbf_file.html



Rahul S. Johari escribió:
I do believe that what I'm doing is scanning the foxpro dbase row  
by row to get the match ... which is why it's returning the results  
very slow.
But I don't know if there's any other way to do this. Basically the  
FoxPro DBF has 75,000 records and I have to search for the one row  
which has the Phone number I'm looking for, and display results. If  
there's any other way to do this ... I'll be more then happy to try.

On Nov 24, 2009, at 9:55 AM, keyser soze wrote:

i will try to help you
but think i'm old in Fox but new in php
and sadly never used php+fox

so, reading your code
i see you are scanning the whole dbf file from php
Fox cant help you in this way

if there is not another option for scan a dbf
the row by row method is very slow




Rahul S. Johari escribió:
Your post definitely gives me hope. It's possible I'm doing  
something wrong!
I definitely have the foxpro database indexed. I use this FoxPro  
command ...

INDEX ON PHONE TAG PHONE
I do have a .CDX file present for the Database and if I MODIFY  
STRUCTURE and I can see the INDEX present on PHONE.
Did you check my Code? Is there any other way to pull records off  
a FoxPro Database? Can you use SQL Commands via PHP on FoxPro  
databases (SELECT * FROM  ) ?

Thanks
On Nov 24, 2009, at 9:16 AM, keyser soze wrote:

even though the dbf has 10K records
Fox can't spend minutes to found a match
by the way, its very strange
to have 35 columns in a table/dbf or whatever

pay attention to the comment of Ashley
in Fox, you should:

SELECT directory
INDEX on phone_number to idx_directory_phone
- or -
INDEX on phone_number tag phone of cdx_directory

i worked with Fox
with dbfs of 2 millions of records
and the speed is amazing -- using indexes of course!

regards,
ks





Rahul S. Johari escribió:

Ave,
I'm connecting to a foxpro database (dbase) and simply running  
a search to retrieve a record. It's a very simple code.
The problem is, as the database is growing, the search is  
becoming ridiculously slow ... and I mean it's taking  
minutes. When the dbase had 10,000 records ... search was  
fast  efficient ... as if you were connecting to a mySQL  
Database. Now that the database has over 75,000 records and  
still growing ... it's taking minutes to search.
The database has about 35 fields; Search is based on a phone  
number.

This is the code ...
?php
 #Open DBF
 $db = dbase_open(dbase.dbf, 0);
#PULL UP RECORD
 if ($db) {
   $record_numbers = dbase_numrecords($db);
   for ($i = 1; $i = $record_numbers; $i++) {
  $row = dbase_get_record_with_names($db, $i);
  if ($row['PHONE'] == $_POST['PHONE']) {
#Retrieve row  display fields
 echo $row['STUFF'];   }   }
}
?
It works ... but it's getting way too slow.
One thing with FoxPro DBF's is that they use an Index file for  
searches within FoxPro. These are .CDX files which contain the  
Index. You can create an Index on, for example, PHONE field.  
However I don't think there's any way in PHP to reference this  
Index file for faster searches.

Is there any possibility to improve search response time?
Thanks!
---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.
[Email]sleepwal...@rahulsjohari.com
[Web]http://www.rahulsjohari.com



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091124-0, 24/11/2009
Tested on: 24/11/2009 11:16:25 a.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.
[Email]sleepwal...@rahulsjohari.com
[Web]http://www.rahulsjohari.com



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091124-0, 24/11/2009
Tested on: 24/11/2009 11:55:50 a.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.
[Email]sleepwal...@rahulsjohari.com
[Web]http://www.rahulsjohari.com



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091124-0, 24/11/2009
Tested on: 24/11/2009 12:11:02 p.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.

[Email] sleepwal...@rahulsjohari.com
[Web]   http://www.rahulsjohari.com





--

[PHP] Re: dbase_get_record_with_names; Very slow search!!!

2009-11-24 Thread keyser soze

uhh, i don't know
(time ago Fox was multi-platform unix/mac/dos)
did you found that on the web?




Rahul S. Johari escribió:

Keyser,

It gets better -- I'm on a Mac OS X (Leopard)!! As far as I know, there 
isn't a VisualFoxPro ODBC Driver for Mac OS X.




On Nov 24, 2009, at 10:11 AM, keyser soze wrote:


Rahul, my friend
i found this in a first search
perhaps it be helpful

http://www.yinfor.com/blog/archives/2008/01/php_connect_dbf_file.html



Rahul S. Johari escribió:
I do believe that what I'm doing is scanning the foxpro dbase row by 
row to get the match ... which is why it's returning the results very 
slow.
But I don't know if there's any other way to do this. Basically the 
FoxPro DBF has 75,000 records and I have to search for the one row 
which has the Phone number I'm looking for, and display results. If 
there's any other way to do this ... I'll be more then happy to try.

On Nov 24, 2009, at 9:55 AM, keyser soze wrote:

i will try to help you
but think i'm old in Fox but new in php
and sadly never used php+fox

so, reading your code
i see you are scanning the whole dbf file from php
Fox cant help you in this way

if there is not another option for scan a dbf
the row by row method is very slow




Rahul S. Johari escribió:
Your post definitely gives me hope. It's possible I'm doing 
something wrong!
I definitely have the foxpro database indexed. I use this FoxPro 
command ...

INDEX ON PHONE TAG PHONE
I do have a .CDX file present for the Database and if I MODIFY 
STRUCTURE and I can see the INDEX present on PHONE.
Did you check my Code? Is there any other way to pull records off a 
FoxPro Database? Can you use SQL Commands via PHP on FoxPro 
databases (SELECT * FROM  ) ?

Thanks
On Nov 24, 2009, at 9:16 AM, keyser soze wrote:

even though the dbf has 10K records
Fox can't spend minutes to found a match
by the way, its very strange
to have 35 columns in a table/dbf or whatever

pay attention to the comment of Ashley
in Fox, you should:

SELECT directory
INDEX on phone_number to idx_directory_phone
- or -
INDEX on phone_number tag phone of cdx_directory

i worked with Fox
with dbfs of 2 millions of records
and the speed is amazing -- using indexes of course!

regards,
ks





Rahul S. Johari escribió:

Ave,
I'm connecting to a foxpro database (dbase) and simply running a 
search to retrieve a record. It's a very simple code.
The problem is, as the database is growing, the search is 
becoming ridiculously slow ... and I mean it's taking minutes. 
When the dbase had 10,000 records ... search was fast  efficient 
... as if you were connecting to a mySQL Database. Now that the 
database has over 75,000 records and still growing ... it's 
taking minutes to search.

The database has about 35 fields; Search is based on a phone number.
This is the code ...
?php
 #Open DBF
 $db = dbase_open(dbase.dbf, 0);
#PULL UP RECORD
 if ($db) {
   $record_numbers = dbase_numrecords($db);
   for ($i = 1; $i = $record_numbers; $i++) {
  $row = dbase_get_record_with_names($db, $i);
  if ($row['PHONE'] == $_POST['PHONE']) {
#Retrieve row  display fields
 echo $row['STUFF'];   }   }
}
?
It works ... but it's getting way too slow.
One thing with FoxPro DBF's is that they use an Index file for 
searches within FoxPro. These are .CDX files which contain the 
Index. You can create an Index on, for example, PHONE field. 
However I don't think there's any way in PHP to reference this 
Index file for faster searches.

Is there any possibility to improve search response time?
Thanks!
---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.
[Email]sleepwal...@rahulsjohari.com
[Web]http://www.rahulsjohari.com



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091124-0, 24/11/2009
Tested on: 24/11/2009 11:16:25 a.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.
[Email]sleepwal...@rahulsjohari.com
[Web]http://www.rahulsjohari.com



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091124-0, 24/11/2009
Tested on: 24/11/2009 11:55:50 a.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.
[Email]sleepwal...@rahulsjohari.com
[Web]http://www.rahulsjohari.com



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091124-0, 24/11/2009
Tested on: 24/11/2009 12:11:02 p.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




---
Rahul Sitaram Johari
Founder, Internet 

Re: [PHP] Re: dbase_get_record_with_names; Very slow search!!!

2009-11-24 Thread Rahul S. Johari
Back in 1996 FoxPro was multi-platform. The last FoxPro version  
released for Mac was Visual FoxPro 3.0b (1996). After that Microsoft  
bought FoxPro and Mac Support/Development was cut off. As of now,  
there are NO known ODBC Drivers for FoxPro for the Mac Platform.


So that aside ... back to Original Topic:

Still no solution for a faster search through the dbf via PHP.


On Nov 24, 2009, at 11:11 AM, keyser soze wrote:


uhh, i don't know
(time ago Fox was multi-platform unix/mac/dos)
did you found that on the web?




Rahul S. Johari escribió:

Keyser,
It gets better -- I'm on a Mac OS X (Leopard)!! As far as I know,  
there isn't a VisualFoxPro ODBC Driver for Mac OS X.

On Nov 24, 2009, at 10:11 AM, keyser soze wrote:

Rahul, my friend
i found this in a first search
perhaps it be helpful

http://www.yinfor.com/blog/archives/2008/01/ 
php_connect_dbf_file.html




Rahul S. Johari escribió:
I do believe that what I'm doing is scanning the foxpro dbase row  
by row to get the match ... which is why it's returning the  
results very slow.
But I don't know if there's any other way to do this. Basically  
the FoxPro DBF has 75,000 records and I have to search for the  
one row which has the Phone number I'm looking for, and display  
results. If there's any other way to do this ... I'll be more  
then happy to try.

On Nov 24, 2009, at 9:55 AM, keyser soze wrote:

i will try to help you
but think i'm old in Fox but new in php
and sadly never used php+fox

so, reading your code
i see you are scanning the whole dbf file from php
Fox cant help you in this way

if there is not another option for scan a dbf
the row by row method is very slow




Rahul S. Johari escribió:
Your post definitely gives me hope. It's possible I'm doing  
something wrong!
I definitely have the foxpro database indexed. I use this  
FoxPro command ...

INDEX ON PHONE TAG PHONE
I do have a .CDX file present for the Database and if I MODIFY  
STRUCTURE and I can see the INDEX present on PHONE.
Did you check my Code? Is there any other way to pull records  
off a FoxPro Database? Can you use SQL Commands via PHP on  
FoxPro databases (SELECT * FROM  ) ?

Thanks
On Nov 24, 2009, at 9:16 AM, keyser soze wrote:

even though the dbf has 10K records
Fox can't spend minutes to found a match
by the way, its very strange
to have 35 columns in a table/dbf or whatever

pay attention to the comment of Ashley
in Fox, you should:

SELECT directory
INDEX on phone_number to idx_directory_phone
- or -
INDEX on phone_number tag phone of cdx_directory

i worked with Fox
with dbfs of 2 millions of records
and the speed is amazing -- using indexes of course!

regards,
ks





Rahul S. Johari escribió:

Ave,
I'm connecting to a foxpro database (dbase) and simply  
running a search to retrieve a record. It's a very simple code.
The problem is, as the database is growing, the search is  
becoming ridiculously slow ... and I mean it's taking  
minutes. When the dbase had 10,000 records ... search was  
fast  efficient ... as if you were connecting to a mySQL  
Database. Now that the database has over 75,000 records and  
still growing ... it's taking minutes to search.
The database has about 35 fields; Search is based on a phone  
number.

This is the code ...
?php
#Open DBF
$db = dbase_open(dbase.dbf, 0);
   #PULL UP RECORD
if ($db) {
  $record_numbers = dbase_numrecords($db);
  for ($i = 1; $i = $record_numbers; $i++) {
 $row = dbase_get_record_with_names($db, $i);
 if ($row['PHONE'] == $_POST['PHONE']) {
   #Retrieve row  display fields
echo $row['STUFF'];   }   }
}
?
It works ... but it's getting way too slow.
One thing with FoxPro DBF's is that they use an Index file  
for searches within FoxPro. These are .CDX files which  
contain the Index. You can create an Index on, for example,  
PHONE field. However I don't think there's any way in PHP to  
reference this Index file for faster searches.

Is there any possibility to improve search response time?
Thanks!
---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.
[Email]sleepwal...@rahulsjohari.com
[Web]http://www.rahulsjohari.com



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091124-0, 24/11/2009
Tested on: 24/11/2009 11:16:25 a.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.
[Email]sleepwal...@rahulsjohari.com
[Web]http://www.rahulsjohari.com



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091124-0, 24/11/2009
Tested on: 24/11/2009 11:55:50 a.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



---
Rahul Sitaram Johari
Founder, Internet