Discussion:
Numeric(x,0) vs Integer field type in VFP tables
m***@mbsoftwaresolutions.com
2018-04-04 19:43:20 UTC
Permalink
VFP9

I don't see why folks would use Numeric(X,0) where X > 4 instead of an
Integer field. Can you tell me why? I'm guessing it's leftover legacy
design?

tia,
--Mike

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/***@mbsoftwaresolutions.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Fernando D. Bozzo
2018-04-04 20:53:29 UTC
Permalink
Not counting legacy reasons for already available systems, I think that
this is because many did not learn about the available data types and just
stay with what they know, others because did think that are the same, and
others because they don't care.

I know some of those guys, btw.
Post by m***@mbsoftwaresolutions.com
VFP9
I don't see why folks would use Numeric(X,0) where X > 4 instead of an
Integer field. Can you tell me why? I'm guessing it's leftover legacy
design?
tia,
--Mike
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CAGQ_Ju=***@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
m***@mbsoftwaresolutions.com
2018-04-05 03:05:44 UTC
Permalink
Post by Fernando D. Bozzo
Not counting legacy reasons for already available systems, I think that
this is because many did not learn about the available data types and just
stay with what they know, others because did think that are the same, and
others because they don't care.
I know some of those guys, btw.
ALBEIT PROBABLY MINISCULE, won't the Integer type be a better, more
efficient, faster processing choice? I noticed in this app I inherited,
the main table where it's the PK, it's an INTEGER type, but in a another
table where it's the foreign key, it's a N(10,0) type. I'll have to
break out SYS(3054) I guess to see if it optimizes, given the
difference!

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/***@mbsoftwaresolutions.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Fernando D. Bozzo
2018-04-05 05:20:32 UTC
Permalink
Yes, in this case INT is much better because it only need 4 bytes on disk
and have direct hex interpretation, while the number occupies 10 bytes and
need digit by digit calculation.

Being both data types related, I thing that it's a secure assumption that
the number field can be replaced by the INT data type.


El jue., 5 de abril de 2018 5:05, <
Post by m***@mbsoftwaresolutions.com
Post by Fernando D. Bozzo
Not counting legacy reasons for already available systems, I think that
this is because many did not learn about the available data types and just
stay with what they know, others because did think that are the same, and
others because they don't care.
I know some of those guys, btw.
ALBEIT PROBABLY MINISCULE, won't the Integer type be a better, more
efficient, faster processing choice? I noticed in this app I inherited,
the main table where it's the PK, it's an INTEGER type, but in a another
table where it's the foreign key, it's a N(10,0) type. I'll have to
break out SYS(3054) I guess to see if it optimizes, given the
difference!
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CAGQ_JukqbCLryDREi_8HvtF=vOjSdX_EU3gRUm6C1hDa4c=***@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obv
m***@mbsoftwaresolutions.com
2018-04-05 13:40:23 UTC
Permalink
Post by Fernando D. Bozzo
Yes, in this case INT is much better because it only need 4 bytes on disk
and have direct hex interpretation, while the number occupies 10 bytes and
need digit by digit calculation.
Being both data types related, I thing that it's a secure assumption that
the number field can be replaced by the INT data type.
I agree -- I'd feel completely fine converting anything N(5+,0) to Int.

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/***@mbsoftwaresolutions.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Paul H. Tarver
2018-04-05 13:54:50 UTC
Permalink
Speaking of SYS(3054) & SYS(3092), I have to be honest and admit I have not
been using these amazing tools until recently trusting my instinct that my
queries were optimized based on the speeds I was achieving just by creating
various indexes. A recent thread on this group convinced me to spend some
time and learn how to use these features and I tried them out on an almost
completed project and frankly, I really wasn't expecting much of an
improvement over what I already had in place.

OMG! I got a 75% improvement in performance applying the feedback I got from
the test results. Unbelievable. I'm now trying to apply this to every active
project and I have a couple of old projects I'm going to retro-fit. Holy
crap! I just thought FoxPro was fast before.

I just had to share and tell this group THANK YOU!

Paul

-----Original Message-----
From: ProfoxTech [mailto:profoxtech-***@leafe.com] On Behalf Of
***@mbsoftwaresolutions.com
Sent: Wednesday, April 04, 2018 10:06 PM
To: ***@leafe.com
Subject: Re: Numeric(x,0) vs Integer field type in VFP tables
Post by Fernando D. Bozzo
Not counting legacy reasons for already available systems, I think
that this is because many did not learn about the available data types
and just stay with what they know, others because did think that are
the same, and others because they don't care.
I know some of those guys, btw.
ALBEIT PROBABLY MINISCULE, won't the Integer type be a better, more
efficient, faster processing choice? I noticed in this app I inherited, the
main table where it's the PK, it's an INTEGER type, but in a another table
where it's the foreign key, it's a N(10,0) type. I'll have to break out
SYS(3054) I guess to see if it optimizes, given the difference!

[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/003501d3cce5$ac798ae0$056ca0a0$@tpcqpc.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Gene Wirchenko
2018-04-05 17:19:33 UTC
Permalink
Post by m***@mbsoftwaresolutions.com
VFP9
I don't see why folks would use Numeric(X,0) where X > 4 instead of
an Integer field. Can you tell me why? I'm guessing it's leftover
legacy design?
There are a couple that I can think of:

1) Often, the numbers that I am dealing with are defined by number
of digits. For example, my app has work order numbers of up to
999999. "N(6)" covers that nicely and even documents it.

2) The column width in a browse for a column defined as N(?) will
be just right (assuming the caption is not too wide). If I declare
the column as integer, it will be wider than necesssary.

Sincerely,

Gene Wirchenko


_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/***@mtlp000087
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
m***@mbsoftwaresolutions.com
2018-04-05 21:14:09 UTC
Permalink
Post by Gene Wirchenko
Post by m***@mbsoftwaresolutions.com
VFP9
I don't see why folks would use Numeric(X,0) where X > 4 instead of an
Integer field. Can you tell me why? I'm guessing it's leftover
legacy design?
1) Often, the numbers that I am dealing with are defined by number
of digits. For example, my app has work order numbers of up to
999999. "N(6)" covers that nicely and even documents it.
2) The column width in a browse for a column defined as N(?) will be
just right (assuming the caption is not too wide). If I declare the
column as integer, it will be wider than necesssary.
Interesting...thanks, Gene!

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/***@mbsoftwaresolutions.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Gene Wirchenko
2018-04-06 17:28:49 UTC
Permalink
Post by m***@mbsoftwaresolutions.com
Post by Gene Wirchenko
Post by m***@mbsoftwaresolutions.com
VFP9
I don't see why folks would use Numeric(X,0) where X > 4 instead
of an Integer field. Can you tell me why? I'm guessing it's
leftover legacy design?
1) Often, the numbers that I am dealing with are defined by number
of digits. For example, my app has work order numbers of up to
999999. "N(6)" covers that nicely and even documents it.
2) The column width in a browse for a column defined as N(?) will be
just right (assuming the caption is not too wide). If I declare the
column as integer, it will be wider than necesssary.
Interesting...thanks, Gene!
You are welcome.

3) Some other software might be expecting only values of the
particular size and if you do not make sure that the values are that
way, interesting things might happen. For example, N(4) is just
right for four-digit numbers and that other program might be defined
that way. If your declaration is 16-bit int ... <I am sure you have
a good imagination>. COBOL has numbers declared by number of digits
as does PL/I. There may be other languages.

Sincerely,

Gene Wirchenko


_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/***@mtlp000083
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
m***@mbsoftwaresolutions.com
2018-04-06 19:08:16 UTC
Permalink
Post by Gene Wirchenko
3) Some other software might be expecting only values of the
particular size and if you do not make sure that the values are that
way, interesting things might happen. For example, N(4) is just right
for four-digit numbers and that other program might be defined that
way. If your declaration is 16-bit int ... <I am sure you have a
good imagination>. COBOL has numbers declared by number of digits as
does PL/I. There may be other languages.
I noticed in Oracle there doesn't appear to be an Integer type; it's
defined as something huge like N(36,0) if I recall correctly.

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/***@mbsoftwaresolutions.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Loading...