Discussion:
Slow accessing database over the network
(too old to reply)
Feldaspar
2007-02-28 03:46:07 UTC
Permalink
Hi,

I'm using C# to accessing DBF data using the vfpoledb.1 driver. When i
run queries from the appliction on the same machine that the database
resides on the queries are fast, but when i try to run them over the
network, (database on one machine, my C# app on another machine) they
run very, very, very slow.

Anyone had any experience with this area and could offer suggestions?

Andrew
Josh Assing
2007-02-28 04:06:22 UTC
Permalink
Access teh data on the "server" and return only the result set.

When you access a database and issue a query; it accesses the ENTIRE database.

so you're actually fetching the entire table over the network....
Post by Feldaspar
Hi,
I'm using C# to accessing DBF data using the vfpoledb.1 driver. When i
run queries from the appliction on the same machine that the database
resides on the queries are fast, but when i try to run them over the
network, (database on one machine, my C# app on another machine) they
run very, very, very slow.
Anyone had any experience with this area and could offer suggestions?
Andrew
--- AntiSpam/harvest ---
Remove X's to send email to me.
Feldaspar
2007-02-28 04:38:15 UTC
Permalink
How...?
Post by Josh Assing
Access teh data on the "server" and return only the result set.
When you access a database and issue a query; it accesses the ENTIRE database.
so you're actually fetching the entire table over the network....
Post by Feldaspar
Hi,
I'm using C# to accessing DBF data using the vfpoledb.1 driver. When i
run queries from the appliction on the same machine that the database
resides on the queries are fast, but when i try to run them over the
network, (database on one machine, my C# app on another machine) they
run very, very, very slow.
Anyone had any experience with this area and could offer suggestions?
Andrew
--- AntiSpam/harvest ---
Remove X's to send email to me.
swdev2
2007-02-28 05:33:35 UTC
Permalink
Make a dot net assembly that runs as a server piece. It ain't COM or COM+,
but you may wanna take a look at the Sedna set of tools - you can design
what you need in Sedna for the data layer, and call the piece from C#.

It's the poor man's client/server architecture (poor cause cheap to license,
man cause it takes a MAN to write the code for the server piece).

Good Luck !
Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql / MS-SQL
www.efgroup.net/vfpwebhosting
www.terrafox.net www.viasqlserver.net
Post by Feldaspar
How...?
Post by Josh Assing
Access teh data on the "server" and return only the result set.
When you access a database and issue a query; it accesses the ENTIRE database.
so you're actually fetching the entire table over the network....
Post by Feldaspar
Hi,
I'm using C# to accessing DBF data using the vfpoledb.1 driver. When i
run queries from the appliction on the same machine that the database
resides on the queries are fast, but when i try to run them over the
network, (database on one machine, my C# app on another machine) they
run very, very, very slow.
Anyone had any experience with this area and could offer suggestions?
Andrew
--- AntiSpam/harvest ---
Remove X's to send email to me.
Feldaspar
2007-02-28 11:03:14 UTC
Permalink
HI,

So there is no way you know of using OleDb or Odbc drivers in .net
that would speed up this process, without having to have a data layer
on the server? There's no connection string property that would force
the query to be run on the server?

Andrwe
Post by swdev2
Make a dot net assembly that runs as a server piece. It ain't COM or COM+,
but you may wanna take a look at the Sedna set of tools - you can design
what you need in Sedna for the data layer, and call the piece from C#.
It's the poor man's client/server architecture (poor cause cheap to license,
man cause it takes a MAN to write the code for the server piece).
Good Luck !
Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql / MS-SQLwww.efgroup.net/vfpwebhostingwww.terrafox.net www.viasqlserver.net
Post by Feldaspar
How...?
Post by Josh Assing
Access teh data on the "server" and return only the result set.
When you access a database and issue a query; it accesses the ENTIRE
database.
Post by Feldaspar
Post by Josh Assing
so you're actually fetching the entire table over the network....
Post by Feldaspar
Hi,
I'm using C# to accessing DBF data using the vfpoledb.1 driver. When i
run queries from the appliction on the same machine that the database
resides on the queries are fast, but when i try to run them over the
network, (database on one machine, my C# app on another machine) they
run very, very, very slow.
Anyone had any experience with this area and could offer suggestions?
Andrew
--- AntiSpam/harvest ---
Remove X's to send email to me.- Hide quoted text -
- Show quoted text -
Josh Assing
2007-02-28 13:40:35 UTC
Permalink
Post by Feldaspar
So there is no way you know of using OleDb or Odbc drivers in .net
it'd slow it down by adding yet another layer.

You need to stop dragging the entire database across the network -- do the query
ON the system that phsyically holds the database (making a simple data-sever).

An example might be something like this:

You create your query in a dbf -- the table has two fields, both memo.
"QUERY" "RESULTS"

You put your query code (select .....) into the query memo field.
The "server" constantly scans a directory, when it sees a new file w/ empty
"results" field, it runs the query & populates the "results" field with XML.

When your app sees the xml code, it converts it back to a cursor & boom -- you
ahve your results w/o dragging entire databases across the network.

This is a very simple solution, and not optimized or ideal.
Post by Feldaspar
that would speed up this process, without having to have a data layer
on the server? There's no connection string property that would force
the query to be run on the server?
Use SQL server.
Post by Feldaspar
Andrwe
Post by swdev2
Make a dot net assembly that runs as a server piece. It ain't COM or COM+,
but you may wanna take a look at the Sedna set of tools - you can design
what you need in Sedna for the data layer, and call the piece from C#.
It's the poor man's client/server architecture (poor cause cheap to license,
man cause it takes a MAN to write the code for the server piece).
Good Luck !
Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql / MS-SQLwww.efgroup.net/vfpwebhostingwww.terrafox.net www.viasqlserver.net
Post by Feldaspar
How...?
Post by Josh Assing
Access teh data on the "server" and return only the result set.
When you access a database and issue a query; it accesses the ENTIRE
database.
Post by Feldaspar
Post by Josh Assing
so you're actually fetching the entire table over the network....
Post by Feldaspar
Hi,
I'm using C# to accessing DBF data using the vfpoledb.1 driver. When i
run queries from the appliction on the same machine that the database
resides on the queries are fast, but when i try to run them over the
network, (database on one machine, my C# app on another machine) they
run very, very, very slow.
Anyone had any experience with this area and could offer suggestions?
Andrew
--- AntiSpam/harvest ---
Remove X's to send email to me.- Hide quoted text -
- Show quoted text -
--- AntiSpam/harvest ---
Remove X's to send email to me.
swdev2
2007-02-28 19:00:00 UTC
Permalink
Yo Yo Andrew...

At this stage, without writing another line o code -
you are NOT in client/server environment.
You are in File Server Environment (Only).

If you wish to reduce the amount o time a query set is returned, then you
have to reduce
the network traffic. As is, you are having to use the entire table or set of
tables, and bringing a lot of things over the pipe, and ALSO (I assume) you
are kicking the entire operation into table scan mode.

One way (which I alluded to previously) would be to build a server program
or server component (depending on your server architecture)
that accepts 'queries' and then returns 'results set(s)'

There are many ways to accomplish this - I mention Sedna because you are
dealing with VFP data AND using C#. There is a CTP distro set of Sedna
Available - see http://msdn.microsoft.com/vfoxpro as a starting point to get
this distro set.

You can back off a bit in the technology timeline, and build, instead, a VFP
COM Server that runs ON the server, that accepts
your query, and returns, for example, the NAME of the smaller table that was
created during the Server.procedure call.
Then your C# piece can get to the SMALLER table either via direct copy or
odbc .

That's just ONE example.

There are many others.
Confused? Need a hands-on mentor? Check out the Sydney VFP User Group at
http://www.svfpug.com.au/
contact one of the officers, and go forth.

Good Luck!
Mondo Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql / MS-SQL
www.efgroup.net/vfpwebhosting
www.terrafox.net www.viasqlserver.net
Post by Feldaspar
HI,
So there is no way you know of using OleDb or Odbc drivers in .net
that would speed up this process, without having to have a data layer
on the server? There's no connection string property that would force
the query to be run on the server?
Andrwe
Post by swdev2
Make a dot net assembly that runs as a server piece. It ain't COM or COM+,
but you may wanna take a look at the Sedna set of tools - you can design
what you need in Sedna for the data layer, and call the piece from C#.
It's the poor man's client/server architecture (poor cause cheap to license,
man cause it takes a MAN to write the code for the server piece).
Good Luck !
Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql /
MS-SQLwww.efgroup.net/vfpwebhostingwww.terrafox.net www.viasqlserver.net
Post by Feldaspar
Post by swdev2
Post by Feldaspar
How...?
Post by Josh Assing
Access teh data on the "server" and return only the result set.
When you access a database and issue a query; it accesses the ENTIRE
database.
Post by Feldaspar
Post by Josh Assing
so you're actually fetching the entire table over the network....
Post by Feldaspar
Hi,
I'm using C# to accessing DBF data using the vfpoledb.1 driver. When i
run queries from the appliction on the same machine that the database
resides on the queries are fast, but when i try to run them over the
network, (database on one machine, my C# app on another machine) they
run very, very, very slow.
Anyone had any experience with this area and could offer suggestions?
Andrew
--- AntiSpam/harvest ---
Remove X's to send email to me.- Hide quoted text -
- Show quoted text -
Feldaspar
2007-02-28 20:01:21 UTC
Permalink
Hi..

What if i set the application working directory to the directory of
the database on the server when i execute a query? Stupid?
Post by swdev2
Yo Yo Andrew...
At this stage, without writing another line o code -
you are NOT in client/server environment.
You are in File Server Environment (Only).
If you wish to reduce the amount o time a query set is returned, then you
have to reduce
the network traffic. As is, you are having to use the entire table or set of
tables, and bringing a lot of things over the pipe, and ALSO (I assume) you
are kicking the entire operation into table scan mode.
One way (which I alluded to previously) would be to build a server program
or server component (depending on your server architecture)
that accepts 'queries' and then returns 'results set(s)'
There are many ways to accomplish this - I mention Sedna because you are
dealing with VFP data AND using C#. There is a CTP distro set of Sedna
Available - seehttp://msdn.microsoft.com/vfoxproas a starting point to get
this distro set.
You can back off a bit in the technology timeline, and build, instead, a VFP
COM Server that runs ON the server, that accepts
your query, and returns, for example, the NAME of the smaller table that was
created during the Server.procedure call.
Then your C# piece can get to the SMALLER table either via direct copy or
odbc .
That's just ONE example.
There are many others.
Confused? Need a hands-on mentor? Check out the Sydney VFP User Group athttp://www.svfpug.com.au/
contact one of the officers, and go forth.
Good Luck!
Mondo Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql / MS-SQLwww.efgroup.net/vfpwebhostingwww.terrafox.net www.viasqlserver.net
Post by Feldaspar
HI,
So there is no way you know of using OleDb or Odbc drivers in .net
that would speed up this process, without having to have a data layer
on the server? There's no connection string property that would force
the query to be run on the server?
Andrwe
Post by swdev2
Make a dot net assembly that runs as a server piece. It ain't COM or
COM+,
Post by Feldaspar
Post by swdev2
but you may wanna take a look at the Sedna set of tools - you can design
what you need in Sedna for the data layer, and call the piece from C#.
It's the poor man's client/server architecture (poor cause cheap to
license,
Post by Feldaspar
Post by swdev2
man cause it takes a MAN to write the code for the server piece).
Good Luck !
Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql /
MS-SQLwww.efgroup.net/vfpwebhostingwww.terrafox.netwww.viasqlserver.net
Post by Feldaspar
Post by swdev2
Post by Feldaspar
How...?
Post by Josh Assing
Access teh data on the "server" and return only the result set.
When you access a database and issue a query; it accesses the ENTIRE
database.
Post by Feldaspar
Post by Josh Assing
so you're actually fetching the entire table over the network....
Post by Feldaspar
Hi,
I'm using C# to accessing DBF data using the vfpoledb.1 driver.
When i
Post by Feldaspar
Post by swdev2
Post by Feldaspar
Post by Josh Assing
Post by Feldaspar
run queries from the appliction on the same machine that the
database
Post by Feldaspar
Post by swdev2
Post by Feldaspar
Post by Josh Assing
Post by Feldaspar
resides on the queries are fast, but when i try to run them over
the
Post by Feldaspar
Post by swdev2
Post by Feldaspar
Post by Josh Assing
Post by Feldaspar
network, (database on one machine, my C# app on another machine)
they
Post by Feldaspar
Post by swdev2
Post by Feldaspar
Post by Josh Assing
Post by Feldaspar
run very, very, very slow.
Anyone had any experience with this area and could offer
suggestions?
Post by Feldaspar
Post by swdev2
Post by Feldaspar
Post by Josh Assing
Post by Feldaspar
Andrew
--- AntiSpam/harvest ---
Remove X's to send email to me.- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -
Josh Assing
2007-02-28 20:42:02 UTC
Permalink
Post by Feldaspar
What if i set the application working directory to the directory of
the database on the server when i execute a query? Stupid?
is the application running on the server or locally?
will data transmit across the network?
Post by Feldaspar
Post by swdev2
Yo Yo Andrew...
At this stage, without writing another line o code -
you are NOT in client/server environment.
You are in File Server Environment (Only).
If you wish to reduce the amount o time a query set is returned, then you
have to reduce
the network traffic. As is, you are having to use the entire table or set of
tables, and bringing a lot of things over the pipe, and ALSO (I assume) you
are kicking the entire operation into table scan mode.
One way (which I alluded to previously) would be to build a server program
or server component (depending on your server architecture)
that accepts 'queries' and then returns 'results set(s)'
There are many ways to accomplish this - I mention Sedna because you are
dealing with VFP data AND using C#. There is a CTP distro set of Sedna
Available - seehttp://msdn.microsoft.com/vfoxproas a starting point to get
this distro set.
You can back off a bit in the technology timeline, and build, instead, a VFP
COM Server that runs ON the server, that accepts
your query, and returns, for example, the NAME of the smaller table that was
created during the Server.procedure call.
Then your C# piece can get to the SMALLER table either via direct copy or
odbc .
That's just ONE example.
There are many others.
Confused? Need a hands-on mentor? Check out the Sydney VFP User Group athttp://www.svfpug.com.au/
contact one of the officers, and go forth.
Good Luck!
Mondo Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql / MS-SQLwww.efgroup.net/vfpwebhostingwww.terrafox.net www.viasqlserver.net
Post by Feldaspar
HI,
So there is no way you know of using OleDb or Odbc drivers in .net
that would speed up this process, without having to have a data layer
on the server? There's no connection string property that would force
the query to be run on the server?
Andrwe
Post by swdev2
Make a dot net assembly that runs as a server piece. It ain't COM or
COM+,
Post by Feldaspar
Post by swdev2
but you may wanna take a look at the Sedna set of tools - you can design
what you need in Sedna for the data layer, and call the piece from C#.
It's the poor man's client/server architecture (poor cause cheap to
license,
Post by Feldaspar
Post by swdev2
man cause it takes a MAN to write the code for the server piece).
Good Luck !
Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql /
MS-SQLwww.efgroup.net/vfpwebhostingwww.terrafox.netwww.viasqlserver.net
Post by Feldaspar
Post by swdev2
Post by Feldaspar
How...?
Post by Josh Assing
Access teh data on the "server" and return only the result set.
When you access a database and issue a query; it accesses the ENTIRE
database.
Post by Feldaspar
Post by Josh Assing
so you're actually fetching the entire table over the network....
Post by Feldaspar
Hi,
I'm using C# to accessing DBF data using the vfpoledb.1 driver.
When i
Post by Feldaspar
Post by swdev2
Post by Feldaspar
Post by Josh Assing
Post by Feldaspar
run queries from the appliction on the same machine that the
database
Post by Feldaspar
Post by swdev2
Post by Feldaspar
Post by Josh Assing
Post by Feldaspar
resides on the queries are fast, but when i try to run them over
the
Post by Feldaspar
Post by swdev2
Post by Feldaspar
Post by Josh Assing
Post by Feldaspar
network, (database on one machine, my C# app on another machine)
they
Post by Feldaspar
Post by swdev2
Post by Feldaspar
Post by Josh Assing
Post by Feldaspar
run very, very, very slow.
Anyone had any experience with this area and could offer
suggestions?
Post by Feldaspar
Post by swdev2
Post by Feldaspar
Post by Josh Assing
Post by Feldaspar
Andrew
--- AntiSpam/harvest ---
Remove X's to send email to me.- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -
--- AntiSpam/harvest ---
Remove X's to send email to me.
swdev2
2007-03-01 02:36:15 UTC
Permalink
Do you see any speed difference when you use ado.net with vfp as the
backend?
Regards [Bill]

--
===================
William Sanders / EFG VFP / mySql / MS-SQL
www.efgroup.net/vfpwebhosting
www.terrafox.net www.viasqlserver.net
Post by Feldaspar
Hi,
I'm using C# to accessing DBF data using the vfpoledb.1 driver. When i
run queries from the appliction on the same machine that the database
resides on the queries are fast, but when i try to run them over the
network, (database on one machine, my C# app on another machine) they
run very, very, very slow.
Anyone had any experience with this area and could offer suggestions?
Andrew
Feldaspar
2007-03-01 10:19:51 UTC
Permalink
Hi Bill,

What do you mean by this?

We tried using p-invoke to a CA-Visual Objects DLL so that it would
get the data for us in to a DBF and then we just grabbed the data out
of that one DBF, but it was still very slow. What I dont understand
(i'm not really in to DBF's) is why a language like Visual Objects can
access the data relatively quickly but a language like SQL is slow.
What does Visual Objects do that SQL doesn't? Is it to do with the
indexes? Can I utilise the indexes in my SQL query somehow?
Post by swdev2
Do you see any speed difference when you use ado.net with vfp as the
backend?
Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql / MS-SQLwww.efgroup.net/vfpwebhostingwww.terrafox.net www.viasqlserver.net
Post by Feldaspar
Hi,
I'm using C# to accessing DBF data using the vfpoledb.1 driver. When i
run queries from the appliction on the same machine that the database
resides on the queries are fast, but when i try to run them over the
network, (database on one machine, my C# app on another machine) they
run very, very, very slow.
Anyone had any experience with this area and could offer suggestions?
Andrew- Hide quoted text -
- Show quoted text -
Feldaspar
2007-03-01 10:46:27 UTC
Permalink
Hi,

Another question... What would creating a stored proceadure do in
terms of speeding things up?

Regards.
Post by Feldaspar
Hi Bill,
What do you mean by this?
We tried using p-invoke to a CA-Visual Objects DLL so that it would
get the data for us in to a DBF and then we just grabbed the data out
of that one DBF, but it was still very slow. What I dont understand
(i'm not really in to DBF's) is why a language like Visual Objects can
access the data relatively quickly but a language like SQL is slow.
What does Visual Objects do that SQL doesn't? Is it to do with the
indexes? Can I utilise the indexes in my SQL query somehow?
Post by swdev2
Do you see any speed difference when you use ado.net with vfp as the
backend?
Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql / MS-SQLwww.efgroup.net/vfpwebhostingwww.terrafox.netwww.viasqlserver.net
Post by Feldaspar
Hi,
I'm using C# to accessing DBF data using the vfpoledb.1 driver. When i
run queries from the appliction on the same machine that the database
resides on the queries are fast, but when i try to run them over the
network, (database on one machine, my C# app on another machine) they
run very, very, very slow.
Anyone had any experience with this area and could offer suggestions?
Andrew- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -
Anders Altberg
2007-03-01 11:16:44 UTC
Permalink
Nothing.
Post by Feldaspar
Hi,
Another question... What would creating a stored proceadure do in
terms of speeding things up?
Regards.
Post by Feldaspar
Hi Bill,
What do you mean by this?
We tried using p-invoke to a CA-Visual Objects DLL so that it would
get the data for us in to a DBF and then we just grabbed the data out
of that one DBF, but it was still very slow. What I dont understand
(i'm not really in to DBF's) is why a language like Visual Objects can
access the data relatively quickly but a language like SQL is slow.
What does Visual Objects do that SQL doesn't? Is it to do with the
indexes? Can I utilise the indexes in my SQL query somehow?
Post by swdev2
Do you see any speed difference when you use ado.net with vfp as the
backend?
Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql /
MS-SQLwww.efgroup.net/vfpwebhostingwww.terrafox.netwww.viasqlserver.net
Post by Feldaspar
Hi,
I'm using C# to accessing DBF data using the vfpoledb.1 driver. When i
run queries from the appliction on the same machine that the database
resides on the queries are fast, but when i try to run them over the
network, (database on one machine, my C# app on another machine) they
run very, very, very slow.
Anyone had any experience with this area and could offer suggestions?
Andrew- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -
Anders Altberg
2007-03-01 11:22:09 UTC
Permalink
Indexes are extremely important. If your WHERE clause mirrors an indexing
expression exactly then VFP will use the index instead of a table scan.
Suppose there's an index on UPPER(lastname) then WHERE
UPPER(lastname)=?myvariable will hit the sweet spot.
It's called Rushmore optimization the underlying optimization thechnology is
one of the reason MS bought FoxPro.

-Anders
Post by Feldaspar
Hi Bill,
What do you mean by this?
We tried using p-invoke to a CA-Visual Objects DLL so that it would
get the data for us in to a DBF and then we just grabbed the data out
of that one DBF, but it was still very slow. What I dont understand
(i'm not really in to DBF's) is why a language like Visual Objects can
access the data relatively quickly but a language like SQL is slow.
What does Visual Objects do that SQL doesn't? Is it to do with the
indexes? Can I utilise the indexes in my SQL query somehow?
Post by swdev2
Do you see any speed difference when you use ado.net with vfp as the
backend?
Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql /
MS-SQLwww.efgroup.net/vfpwebhostingwww.terrafox.net www.viasqlserver.net
Post by Feldaspar
Hi,
I'm using C# to accessing DBF data using the vfpoledb.1 driver. When i
run queries from the appliction on the same machine that the database
resides on the queries are fast, but when i try to run them over the
network, (database on one machine, my C# app on another machine) they
run very, very, very slow.
Anyone had any experience with this area and could offer suggestions?
Andrew- Hide quoted text -
- Show quoted text -
Feldaspar
2007-03-01 11:30:18 UTC
Permalink
What about creating a 'view' or using this SQL-Pass through (not sure
if you can use that in C# though..
Post by Anders Altberg
Indexes are extremely important. If your WHERE clause mirrors an indexing
expression exactly then VFP will use the index instead of a table scan.
Suppose there's an index on UPPER(lastname) then WHERE
UPPER(lastname)=?myvariable will hit the sweet spot.
It's called Rushmore optimization the underlying optimization thechnology is
one of the reason MS bought FoxPro.
-Anders
Post by Feldaspar
Hi Bill,
What do you mean by this?
We tried using p-invoke to a CA-Visual Objects DLL so that it would
get the data for us in to a DBF and then we just grabbed the data out
of that one DBF, but it was still very slow. What I dont understand
(i'm not really in to DBF's) is why a language like Visual Objects can
access the data relatively quickly but a language like SQL is slow.
What does Visual Objects do that SQL doesn't? Is it to do with the
indexes? Can I utilise the indexes in my SQL query somehow?
Post by swdev2
Do you see any speed difference when you use ado.net with vfp as the
backend?
Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql /
MS-SQLwww.efgroup.net/vfpwebhostingwww.terrafox.netwww.viasqlserver.net
Post by Feldaspar
Hi,
I'm using C# to accessing DBF data using the vfpoledb.1 driver. When i
run queries from the appliction on the same machine that the database
resides on the queries are fast, but when i try to run them over the
network, (database on one machine, my C# app on another machine) they
run very, very, very slow.
Anyone had any experience with this area and could offer suggestions?
Andrew- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -
Josh Assing
2007-03-01 16:00:05 UTC
Permalink
Post by Feldaspar
What about creating a 'view' or using this SQL-Pass through (not sure
if you can use that in C# though..
Are you going to use an sql server?
Ultimately what is going to be processing your data/query?

You're working with a FILE on a remote drive. think about a .DOC file. You
want to do a "search & replace" on it.

NOTHING you can do to that doc except transfer it to your local system do the
work & send it back --- UNLESS you have a program on the same system that can do
the processing & send you the results ("5 items changed")

You cannot say "dear document, please open yourself up on a remote system w/o
any support there do a search and replace and tell me what happened"

I know that's overly simplistic, but a .dbf is JUST a file.
to carry this thru -- even sql server is the same. EXCEPT when you use sql
server (or msde) you are sending requests to a program that is on the same
machine as the data and it is sending you the results.

Short of processing the data/query on teh remote system, there's little you can
do... I guess upgrading the netowrk to a gigabit migth help.
Post by Feldaspar
Post by Anders Altberg
Indexes are extremely important. If your WHERE clause mirrors an indexing
expression exactly then VFP will use the index instead of a table scan.
Suppose there's an index on UPPER(lastname) then WHERE
UPPER(lastname)=?myvariable will hit the sweet spot.
It's called Rushmore optimization the underlying optimization thechnology is
one of the reason MS bought FoxPro.
-Anders
Post by Feldaspar
Hi Bill,
What do you mean by this?
We tried using p-invoke to a CA-Visual Objects DLL so that it would
get the data for us in to a DBF and then we just grabbed the data out
of that one DBF, but it was still very slow. What I dont understand
(i'm not really in to DBF's) is why a language like Visual Objects can
access the data relatively quickly but a language like SQL is slow.
What does Visual Objects do that SQL doesn't? Is it to do with the
indexes? Can I utilise the indexes in my SQL query somehow?
Post by swdev2
Do you see any speed difference when you use ado.net with vfp as the
backend?
Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql /
MS-SQLwww.efgroup.net/vfpwebhostingwww.terrafox.netwww.viasqlserver.net
Post by Feldaspar
Hi,
I'm using C# to accessing DBF data using the vfpoledb.1 driver. When i
run queries from the appliction on the same machine that the database
resides on the queries are fast, but when i try to run them over the
network, (database on one machine, my C# app on another machine) they
run very, very, very slow.
Anyone had any experience with this area and could offer suggestions?
Andrew- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -
--- AntiSpam/harvest ---
Remove X's to send email to me.
swdev2
2007-03-01 15:25:59 UTC
Permalink
Hullo Andrew -

I meant exactly what I said - ado.net with vfp as the backend.

If you are developing in C#, then I'll make a huge leap and assume you have
the entire dot net framework available to you. If not, my apologies. Lotsa
folk use the ado.net 'thing' when writing up a dot-something application. I
just assumed you had it available to you and were using it.

When you say 'a language like SQL' then I have to worry -
as 'SQL' with what you are doing, as is, is mostly an idea, not a language.
There is T-SQL with ms-sql server,
sql variant language built INTO Visual FoxPro
sql variant language available to use inside of any dot net language, always
shoved through a data later or transport of some kind to get to a back end
database.

If you were writing your app in VFP, you could take advantage of the SQL
variant language built in to VFP, which in turn takes advantage of VFP's
RushMore technology, which in turn is blindingly fast as you have indexed
your tables properly and indexed your tables to match the criteria on any
sql join clause, where clause.

Simce you are writing in C#, you have to pay attention to the data layers
and data engines available to you.
MOST folk are using ado.net with C# with vfp as the back end as opposed to
odbc or oledb access.

I would suggest you monitor your network traffic during your data gathering
process, using the FileMon utils now availble free as a d/l from MicroSoft.

Another assumption - when you say 'SQL' below - you mean the sql pass
through available to you via oledb to query a VFP table in C# - so with that
as an assumption - when you say 'What does Visual Objects do that SQL
doesn't?' - that answer is easy - it access the data natively without
another layer of 'stuff' in the way.

By default - dbf native file access is fast fast fast. One can make it
faster by using VFP natively with it's Rushmore Technology.
Also by default - you will have speed issues across the network if you do
NOT set up some server component or server as I mentioned in a previous
reply. You are not using VFP natively, so you won't be seeing any speed
demon access-times with just slogging through a VFP table through oledb or
odbc. Sorry. and JUST TO BE CLEAR - odbc or oledb is NOT native dbf file
access.

Also in a previous reply, I mentioned the Sydney VFP Users Group in Oz. I
reiterate to you - contact one of the officers, acquire a hands-on mentor
for a few days at your site/office . Whilst posting your q's here is
'nice' - you really aren't painting the entire picture of your application
development environment, your application design, your data needs, etc etc.
I will assume you cannot be forthcoming mostly because you are dealing with
company proprietary stuff. You can overcome that by hiring a hands-on
mentor, signing at least a non-disclosure agreement, and going forth with a
2 to 3 day mentoring session.

Here's one last thought - you said:
"We tried using p-invoke to a CA-Visual Objects DLL so that it would
Post by Feldaspar
get the data for us in to a DBF and then we just grabbed the data out
of that one DBF, but it was still very slow."
If you can do that, then you can also build a server program in VFP that
runs ON the server where the data resides. Would suggest you build a server
compenent IN VFP that you can access in C# from across your network.

Remember - VFP is 3 things at once - a programming language, an IDE for
RAD/D and a database. You aren't taking advantage , so far, of anything
that VFP can offer you - You are only approaching your project from a
standpoint of 'we have a dbf file - lets access it somehow via oledb or
odbc'

If you have a MSDN subscription of Pro or better, you will find VFP on the
download section in the subscriber area (once you log in) - get it, download
it, use it.

My apologies if my written tone seems a bit harsh - please remember I had to
clean up my keyboard from the coffee spritz I incurred after reading your
last reply to me.

Mondo Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql / MS-SQL
www.efgroup.net/vfpwebhosting
www.terrafox.net www.viasqlserver.net
Post by Feldaspar
Hi Bill,
What do you mean by this?
What I dont understand
(i'm not really in to DBF's) is why a language like Visual Objects can
access the data relatively quickly but a language like SQL is slow.
What does Visual Objects do that SQL doesn't? Is it to do with the
indexes? Can I utilise the indexes in my SQL query somehow?
Post by swdev2
Do you see any speed difference when you use ado.net with vfp as the
backend?
Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql /
MS-SQLwww.efgroup.net/vfpwebhostingwww.terrafox.net www.viasqlserver.net
Post by Feldaspar
Post by swdev2
Post by Feldaspar
Hi,
I'm using C# to accessing DBF data using the vfpoledb.1 driver. When i
run queries from the appliction on the same machine that the database
resides on the queries are fast, but when i try to run them over the
network, (database on one machine, my C# app on another machine) they
run very, very, very slow.
Anyone had any experience with this area and could offer suggestions?
Andrew- Hide quoted text -
- Show quoted text -
Anders Altberg
2007-03-01 17:35:29 UTC
Permalink
Hi [Bill],
VFPOLEDB.DLL is VFP's data engine isn't it?
-Anders
Post by swdev2
Hullo
Andrew -
just slogging through a VFP table through oledb or
Post by swdev2
odbc. Sorry. and JUST TO BE CLEAR - odbc or oledb is NOT native dbf file
access.
swdev2
2007-03-01 18:59:00 UTC
Permalink
Anders - who knows? Best ask an MVP, I think?
regards [Bill]

--
===================
William Sanders / EFG VFP / mySql / MS-SQL
www.efgroup.net/vfpwebhosting
www.terrafox.net www.viasqlserver.net
Post by Anders Altberg
Hi [Bill],
VFPOLEDB.DLL is VFP's data engine isn't it?
-Anders
Post by swdev2
Hullo
Andrew -
just slogging through a VFP table through oledb or
Post by swdev2
odbc. Sorry. and JUST TO BE CLEAR - odbc or oledb is NOT native dbf file
access.
Anders Altberg
2007-03-01 19:31:17 UTC
Permalink
I was asking myself and the answer was yes, but then I thought you might
have heard different }
-Anders
Post by swdev2
Anders - who knows? Best ask an MVP, I think?
regards [Bill]
--
===================
William Sanders / EFG VFP / mySql / MS-SQL
www.efgroup.net/vfpwebhosting
www.terrafox.net www.viasqlserver.net
Post by Anders Altberg
Hi [Bill],
VFPOLEDB.DLL is VFP's data engine isn't it?
-Anders
Post by swdev2
Hullo
Andrew -
just slogging through a VFP table through oledb or
Post by swdev2
odbc. Sorry. and JUST TO BE CLEAR - odbc or oledb is NOT native dbf
file
Post by Anders Altberg
Post by swdev2
access.
Loading...