| Author |
nubmer of record in index
|
|
|
| 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.
| |
|
| thank you very much
it is working very good
bijan
|
|
|
|