Home > Archive > FoxPro Help and Support > October 2005 > nubmer of record in index









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author nubmer of record in index
bijan

2005-10-27, 8:34 am

Hi
I have a table and I index this table with one condition for example I table
have name of city and I index this table for city that first alphabet equal
with 'f'
And now I want know how many record is in this index .
Is there any function to show this
Thank you

Eric den Doop

2005-10-27, 8:34 am

Here are a two ways:

COUNT TO somevar FOR LEFT(city, 1) = ''f"
?somevar

SELECT city FROM table ;
WHERE LEFT(city, 1) = ''f" ;
INTO ARRAY result
?_tally

Your index hasn't got much to do with the number of records. In this case,
an index on LEFT(city, 1) helps you getting result faster. See VFP help on
Rushmore for details...
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts
Microsoft MVP for Visual FoxPro

"bijan" <bijan@discussions.microsoft.com> wrote in message
news:4A943936-5D8A-4F2B-BF2D- 353DFB261A2A@microso
ft.com...
> Hi
> I have a table and I index this table with one condition for example I
> table
> have name of city and I index this table for city that first alphabet
> equal
> with 'f'
> And now I want know how many record is in this index .
> Is there any function to show this
> Thank you
>



Anders

2005-10-27, 8:34 am

SELECT COUNT(*) FROM Table WHERE city='F'

-Anders

"bijan" <bijan@discussions.microsoft.com> skrev i meddelandet
news:4A943936-5D8A-4F2B-BF2D- 353DFB261A2A@microso
ft.com...
> Hi
> I have a table and I index this table with one condition for example I
> table
> have name of city and I index this table for city that first alphabet
> equal
> with 'f'
> And now I want know how many record is in this index .
> Is there any function to show this
> Thank you
>



Olaf Doschke

2005-10-27, 8:34 am

Hi Bijan,

> I have a table and I index this table with one condition for example I table
> have name of city and I index this table for city that first alphabet equal
> with 'f'
> And now I want know how many record is in this index .



It doesn't make sense to index filtered. You can't even get a count out
of that and the index won't be used for rushmore optimization.

Simply index on the city and then a count for city='f' will be optimized
as a count for city='g' or whatever filter you'd use with the city field.

Bye, Olaf.


bijan

2005-10-27, 8:34 am

thank you very much
it is working very good
bijan
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com