Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 India
 tushar Kanvinde
 To: Samir H.
  Where is Samir H.?
 Yogyakarta
 Indonesia
 Samir H.
 Tags
Subject: RE: Composed Index as primary key?
Thread ID: 268913 Message ID: 268949 # Views: 27 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Thursday, July 15, 2010 3:44:03 PM         
   


> >
> > You need to first find out the range of values that the field can have. So if you have a N(3) field and you know that the value in the field will not exceed 100, you can use BINTOC(1) which will give you a small index. But if you think it may take the value of upto 500, you will have to go to the next step and use BINTOC(2)
> >
> > Regards
> > Tushar
>
> Hi Tushar
> These are all integers, even semester which will have a maximum of 12 (should I change this? You told me once if there are not many fields [4 int + 3 memo in this file], I'll gain something in file size).
> Subject_id should not exceed 200-300 unless users delete & rerecord often. student_id will follow the number of students in the school, I guess a max of 400 if I look at the building they have.
> But you never know, schools expand etc.... What would you suggest that is safe?
> As said, I don't know very much about bintoc() yet.
> Thank you for reply.
>
> Regards
> Samir


For semester you could go for 1S, that will be upto 127, so that is safe. For subject 2S will go to 32K. Hmmmm. I thought adding S would double the range, but testing here gives error for BINTOC(128,'1S')

Regards
Tushar

ENTIRE THREAD

Composed Index as primary key? Posted by Samir H. @ 7/15/2010 11:26:26 AM
RE: Composed Index as primary key? Posted by Cetin Basoz @ 7/15/2010 12:34:34 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/15/2010 1:21:52 PM
RE: Composed Index as primary key? Posted by Cetin Basoz @ 7/15/2010 2:19:09 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/15/2010 2:40:10 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/15/2010 2:03:14 PM
RE: Composed Index as primary key? Posted by tushar @ 7/15/2010 2:16:13 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/15/2010 2:38:39 PM
RE: Composed Index as primary key? Posted by tushar @ 7/15/2010 3:44:03 PM
RE: Composed Index as primary key? Posted by Cetin Basoz @ 7/15/2010 2:35:00 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/15/2010 2:49:40 PM
RE: Composed Index as primary key? Posted by Cetin Basoz @ 7/15/2010 3:45:23 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/15/2010 4:01:37 PM
RE: Composed Index as primary key? Posted by Mike Yearwood @ 7/15/2010 8:21:47 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/16/2010 4:48:41 AM
RE: Composed Index as primary key? Posted by Mike Yearwood @ 7/16/2010 6:07:24 AM
RE: Composed Index as primary key? Posted by Samir H. @ 7/16/2010 6:16:14 AM
RE: Composed Index as primary key? Posted by Cetin Basoz @ 7/16/2010 1:12:42 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/16/2010 1:23:51 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/16/2010 1:46:54 PM
RE: Composed Index as primary key? Posted by tushar @ 7/15/2010 4:02:29 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/15/2010 4:12:41 PM
RE: Composed Index as primary key? Posted by Anders Altberg @ 7/16/2010 1:20:32 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/16/2010 1:31:56 PM