Hi, quick question...

I'm just beginning to develop a document management/retrieval system using
VFP9 & SQL. The main purpose of the program is to allow users the
flexibility to search
for any piece of data by ANY of the numerous fields in the database. I am
using paramatised views to retrieve information from the underlying
tables.

My question is, do I need to create an index for each of the fields on the
remote table given that the user can search on any one (or combination) of
them? What performance benefits will I get from doing so?

Re: SQL Performance by Man-wai

Man-wai
Fri Apr 11 07:42:56 CDT 2008

> My question is, do I need to create an index for each of the fields on the
> remote table given that the user can search on any one (or combination) of
> them? What performance benefits will I get from doing so?

Some fields are usually more frequently searched than others. Build
indexes on them. The rest of the fields should use the slow LOCATE on
the results produced searching popular fields.

Are you going to use a sql server backend, like MySQL or M$ SQL?

--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 7.10) Linux 2.6.24.4
^ ^ 20:40:01 up 10 days 1:51 1 user load average: 1.00 1.01 1.00
? ? (CSSA):
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa/

Re: SQL Performance by AtoutFox

AtoutFox
Fri Apr 11 07:46:12 CDT 2008

Ce message est composé et au format MIME.

------=_NextPart_000_0039_01C89BE2.C931D6E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

The answer is it depends on a lot of factors that we don't know to be =
able to answer, factors like :
a.. Number of records of the database (tables with less than 30000 =
records will be slower with Indexes)=20
b.. Number and types of fields of the tables in the DB=20
c.. Ratio between writings and readings (the more indexes you've got =
the longer the writings will be but the quicker the readings will be ...



"Andy Trezise" <andy@work.com> a =E9crit dans le message de groupe de =
discussion : #2Gwo66mIHA.944@TK2MSFTNGP05.phx.gbl...
> Hi, quick question...
>=20
> I'm just beginning to develop a document management/retrieval system =
using=20
> VFP9 & SQL. The main purpose of the program is to allow users the=20
> flexibility to search
> for any piece of data by ANY of the numerous fields in the database. =
I am=20
> using paramatised views to retrieve information from the underlying
> tables.
>=20
> My question is, do I need to create an index for each of the fields =
on the=20
> remote table given that the user can search on any one (or =
combination) of
> them? What performance benefits will I get from doing so?
>=20
>

------=_NextPart_000_0039_01C89BE2.C931D6E0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dunicode">
<META content=3D"MSHTML 6.00.6000.16608" name=3DGENERATOR></HEAD>
<BODY id=3DMailContainerBody=20
style=3D"PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px"=20
bgColor=3D#ffffff leftMargin=3D0 topMargin=3D0 CanvasTabStop=3D"true"=20
name=3D"Compose message area">
<DIV><FONT face=3DArial>The answer is it depends on a lot of factors =
that we don't=20
know to be able to answer, factors like :</FONT></DIV>
<UL>
<LI><FONT face=3DArial>Number of records of the database (tables with =
less than=20
30000 records will be slower with Indexes)</FONT>=20
<LI><FONT face=3DArial>Number and types of fields of the tables in the =
DB</FONT>=20

<LI><FONT face=3DArial>Ratio between writings and readings (the more =
indexes=20
you've got the longer the writings will be but the quicker the =
readings will=20
be ...<BR></FONT><BR><BR><BR>"Andy Trezise" &lt;andy@work.com&gt; a =
=E9crit dans=20
le message de groupe de discussion :=20
#2Gwo66mIHA.944@TK2MSFTNGP05.phx.gbl...<BR>&gt; Hi, quick =
question...<BR>&gt;=20
<BR>&gt; I'm just beginning to develop a document management/retrieval =
system=20
using <BR>&gt; VFP9 &amp; SQL. The main purpose of the program is to =
allow=20
users the <BR>&gt; flexibility to search<BR>&gt; for any piece of data =
by ANY=20
of the numerous fields in the database. I am <BR>&gt; using =
paramatised views=20
to retrieve information from the underlying<BR>&gt; tables.<BR>&gt; =
<BR>&gt;=20
My question is, do I need to create an index for each of the fields on =
the=20
<BR>&gt; remote table given that the user can search on any one (or=20
combination) of<BR>&gt; them? What performance benefits will I get =
from doing=20
so?<BR>&gt; <BR>&gt;</LI></UL></BODY></HTML>

------=_NextPart_000_0039_01C89BE2.C931D6E0--


Re: SQL Performance by Andy

Andy
Fri Apr 11 07:38:36 CDT 2008

I'm using MYSQL

"Man-wai Chang ToDie (33.6k)" <toylet.toylet@gmail.com> wrote in message
news:uzRYSG9mIHA.5268@TK2MSFTNGP05.phx.gbl...
>> My question is, do I need to create an index for each of the fields on
>> the remote table given that the user can search on any one (or
>> combination) of
>> them? What performance benefits will I get from doing so?
>
> Some fields are usually more frequently searched than others. Build
> indexes on them. The rest of the fields should use the slow LOCATE on the
> results produced searching popular fields.
>
> Are you going to use a sql server backend, like MySQL or M$ SQL?
>
> --
> @~@ Might, Courage, Vision, SINCERITY.
> / v \ Simplicity is Beauty! May the Force and Farce be with you!
> /( _ )\ (Xubuntu 7.10) Linux 2.6.24.4
> ^ ^ 20:40:01 up 10 days 1:51 1 user load average: 1.00 1.01 1.00
> ? ? (CSSA):
> http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa/



Re: SQL Performance by Andy

Andy
Fri Apr 11 07:42:12 CDT 2008

This is a multi-part message in MIME format.

------=_NextPart_000_002C_01C89BD9.D85B9BF0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

The table could have any number of fields (of differing types) as it =
will be defined by the user to suit the type of information that is =
going to be stored within it.

I would image there could be in excess of about 1.5 milliion records=20
"AtoutFox 37" <fox_at_ater.net> wrote in message =
news:%234sDKH9mIHA.6064@TK2MSFTNGP03.phx.gbl...
The answer is it depends on a lot of factors that we don't know to be =
able to answer, factors like :
a.. Number of records of the database (tables with less than 30000 =
records will be slower with Indexes)=20
b.. Number and types of fields of the tables in the DB=20
c.. Ratio between writings and readings (the more indexes you've got =
the longer the writings will be but the quicker the readings will be ...



"Andy Trezise" <andy@work.com> a =E9crit dans le message de groupe =
de discussion : #2Gwo66mIHA.944@TK2MSFTNGP05.phx.gbl...
> Hi, quick question...
>=20
> I'm just beginning to develop a document management/retrieval =
system using=20
> VFP9 & SQL. The main purpose of the program is to allow users the=20
> flexibility to search
> for any piece of data by ANY of the numerous fields in the =
database. I am=20
> using paramatised views to retrieve information from the =
underlying
> tables.
>=20
> My question is, do I need to create an index for each of the =
fields on the=20
> remote table given that the user can search on any one (or =
combination) of
> them? What performance benefits will I get from doing so?
>=20
>

------=_NextPart_000_002C_01C89BD9.D85B9BF0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.6000.16640" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY id=3DMailContainerBody=20
style=3D"PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px"=20
bgColor=3D#ffffff leftMargin=3D0 topMargin=3D0 name=3D"Compose message =
area"=20
CanvasTabStop=3D"true">
<DIV><FONT face=3DArial size=3D2>The table could have any number of =
fields (of=20
differing types) as it will be defined by the user to suit the type of=20
information that is going to be stored within it.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I would image there could be in excess =
of about 1.5=20
milliion records </FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"AtoutFox 37" &lt;fox_at_ater.net&gt; wrote in message <A=20
=
href=3D"news:%234sDKH9mIHA.6064@TK2MSFTNGP03.phx.gbl">news:%234sDKH9mIHA.=
6064@TK2MSFTNGP03.phx.gbl</A>...</DIV>
<DIV><FONT face=3DArial>The answer is it depends on a lot of factors =
that we=20
don't know to be able to answer, factors like :</FONT></DIV>
<UL>
<LI><FONT face=3DArial>Number of records of the database (tables =
with less=20
than 30000 records will be slower with Indexes)</FONT>=20
<LI><FONT face=3DArial>Number and types of fields of the tables in =
the=20
DB</FONT>=20
<LI><FONT face=3DArial>Ratio between writings and readings (the more =
indexes=20
you've got the longer the writings will be but the quicker the =
readings will=20
be ...<BR></FONT><BR><BR><BR>"Andy Trezise" &lt;andy@work.com&gt; a =
=E9crit=20
dans le message de groupe de discussion :=20
#2Gwo66mIHA.944@TK2MSFTNGP05.phx.gbl...<BR>&gt; Hi, quick=20
question...<BR>&gt; <BR>&gt; I'm just beginning to develop a =
document=20
management/retrieval system using <BR>&gt; VFP9 &amp; SQL. The main =
purpose=20
of the program is to allow users the <BR>&gt; flexibility to =
search<BR>&gt;=20
for any piece of data by ANY of the numerous fields in the database. =
I am=20
<BR>&gt; using paramatised views to retrieve information from the=20
underlying<BR>&gt; tables.<BR>&gt; <BR>&gt; My question is, do I =
need to=20
create an index for each of the fields on the <BR>&gt; remote table =
given=20
that the user can search on any one (or combination) of<BR>&gt; =
them? What=20
performance benefits will I get from doing so?<BR>&gt;=20
<BR>&gt;</LI></UL></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_002C_01C89BD9.D85B9BF0--


Re: SQL Performance by Man-wai

Man-wai
Fri Apr 11 08:01:45 CDT 2008

Andy Trezise wrote:
> I'm using MYSQL

Same strategy .... but MySQL has full text search function.


--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 7.10) Linux 2.6.24.4
^ ^ 21:01:01 up 10 days 2:12 1 user load average: 1.05 1.02 1.00
? ? (CSSA):
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa/