![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I can't find any information on the performance differences in indexing using different types. My situation is that I have a structure that would be easier to implement using a multipart 20 char key than using a two, 4 byte integer key. There is, however, a worry that using the larger char key will have an adverse effect on performance. Can anyone shed any light on how large the effect will be? TIA, Ben. |
#3
| |||
| |||
|
|
A nice simple question for a quite complex issue. In short, NO. There are WAY too many variables, including database size, number of records, number of unique records, server CPU, server memory, disk I/O throughput, disk I/O latency, and more. However, I can offer this information: - A larger key will take up more disk space in the file, with the difference between a 20-byte key and an 8-byte key being about 2x (it's not 2.5x since there is additional overhead per key that washes this out). - A larger key will take slightly longer to compare when traversing the B-Tree structure. This may only be 30 or 40 machine language instructions, but it will add up over millions of times. - A larger key will have a deeper B-Tree structure, since not as many keys fit on a page. Of course, on a fully loaded server, you'd likely notice the difference. Since nobody runs servers at 100% capacity any more, you'll likely NOT see any noticable difference unless you're dealing with millions and millions of records. In short, don't worry about the performance difference, and simply do what works best for you and the app. Goldstar Software Inc. Building on Btrieve(R) for the Future(SM) Bill Bach BillBach (AT) goldstarsoftware (DOT) com http://www.goldstarsoftware.com *** Pervasive.SQL Service & Support Classes *** Chicago: March, 2004: See our web site for details! TA1 wrote: Hi, I can't find any information on the performance differences in indexing using different types. My situation is that I have a structure that would be easier to implement using a multipart 20 char key than using a two, 4 byte integer key. There is, however, a worry that using the larger char key will have an adverse effect on performance. Can anyone shed any light on how large the effect will be? TIA, Ben. |
![]() |
| Thread Tools | |
| Display Modes | |
| |