Tinyint better to use or not
I have a question. Is tinyint better to use or not with a 64 bit OS. The Paging on this would be of 64 bit and not 8. And thus tinyint will consume same memory as int(4 byte). How does it actually makes a differen开发者_开发问答ce?
Its for all language or db.
I think the best answer to performance questions like these is
Measure. Don't guess.
- Choose one or more dbms. (They don't all work the same.)
- Build a mock-up of your database using tinyint.
- Build another mock-up using integers.
- Load both with sample data.
EXPLAIN
andEXPLAIN ANALYZE
queries on both databases.
Come back and tell us what you found. (You might be surprised.)
of course a tinyint is faster / smaller than a bigint.
smaller datatypes allow more pages per row, the data is smaller.. indexes are smaller.
it's a BIG deal.
精彩评论