all groups > sql server (alternate) > november 2006 >
You're in the

sql server (alternate)

group:

Maximum number of Tables - is 4^15 big a number?


Maximum number of Tables - is 4^15 big a number? ramraj NO[at]SPAM gmail.com
11/25/2006 6:32:23 PM
sql server (alternate):
Hello people,
I might sound a little bit crazy, but is there any possibility that you
can incorporate 4^15 (1,073,741,824) tables into a SQL Database?

I mean, is it possible at all? There might be a question of where
anyone would want so many tables, but i'm a bioinformatics guy and I'm
trying to deal with genomic sequences and was coming up with a new
algorithm, where the only limit is the number of tables I can put into
a Database.

So, can you please advise if its possible to put in so many tables into
a SQL database? Or is the Bekerley DB better?
Re: Maximum number of Tables - is 4^15 big a number? Erland Sommarskog
11/26/2006 10:34:34 AM
(ramraj@gmail.com) writes:
[quoted text, click to view]

The maximum number of objects in an SQL Server database is 2^31-1,
or 2.147.483.647 and thus > 4^15. "Objects" in this context are tables,
stored procedures, views etc. Note that this answer applies specifically
to MS SQL Server. If you with "SQL Database" means about any RDBMS, beware
that the answer is likely to be different for each product.

I don't really know why you think you need this many tables. But if the
tables all are to have the set of columns, then you only need one table,
but with more columns to keep the different portions of the table apart.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
Re: Maximum number of Tables - is 4^15 big a number? Gert-Jan Strik
11/26/2006 9:35:57 PM
[quoted text, click to view]

In addition to Erland's answer: there might be some practical
limitations.

The smallest possible table, without indexes and only one row will
reserve 16 kilobytes. If you were to create 4^15 tables (without
indexes, primary key and unique constraint), and populate each table
with only 1 row, then you would need 16 TB. If all these tables have a
primary key constraint, that would be 24 TB. Also, if only a few bytes
per 8KB-page are used, then the Buffer Pool cannot be managed
efficiently, with the risk of poor performance.

Gert-Jan

Re: Maximum number of Tables - is 4^15 big a number? Serge Rielau
11/27/2006 12:40:36 AM
.... and if access to the tables in not heavily skewed there will also be
no opportunity for the SQL Compiler to cache query plans.
Death by compile....

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

WAIUG Conference
AddThis Social Bookmark Button