Description of New Integer Data TypeID: Q130545 3.00 WINDOWS kbother The information in this article applies to:
SUMMARYVisual FoxPro version 3.0 has a new data type called Integer. This is a four-byte binary type that is stored as such in memory and on disk. Its range is:
If used, Integers can increase performance and reduce disk space for tables
compared to the other numeric data types.
You will find the new data type in the Table Designer as an "Integer" type. It will also show up in CREATE/ALTER TABLE, DISPLAY STRUCTURE, AFIELDS(), and COPY STRUCTURE EXTENDED.
MORE INFORMATIONIntegers should be familiar to developers using third-generation languages like C/C++ and Pascal. The integer in Visual FoxPro version 3.0 is the same as a signed long in C/C++.
Use integers for non-decimal numbers that are not exceeding the range.
Serial numbers, counters, customer ID numbers are examples. There are two
major advantages to using integers instead of numerics, size and
performance.
SizeIntegers take up less disk space because they are saved on disk in their binary representation. They use only four bytes per number as compared to 10 for numerics. This can be significant savings for large tables. The following is an example, having one CUST_ID field:
PerformanceUsing an integer has several performance advantages over a numeric. First of all, it loads faster from disk. Only four bytes are read from disk compared to 10 for each Numeric. Integers are stored on disk in a binary format. They can be read directly into memory. When numerics are read from disk, a conversion takes place because they are stored as ASCII text strings. Also, the SQL SELECT optimizer has improved performance during joins and queries that use the ORDER BY or GROUP BY clauses. By using integers, Visual FoxPro can generate smaller and more efficient intermediate temporary tables for these queries. Additional reference words: 3.00 VFoxWin kbfest KBCategory: kbother KBSubcategory: FxotherGeneral
|
Last Reviewed: May 1, 1996 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |