Berkeley CSUA MOTD:Entry 21575
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/24 [General] UID:1000 Activity:popular
5/24    

2001/6/19 [Computer/SW/Database] UID:21575 Activity:high
6/19    database question
        is there a way to have a unique ID span a database as opposed to only a
        table... (so that no 2 tables will have records tied using the same
        "autonumber")
        \_ you could have a skinny table of just ID's and have all other tables
           that you care about reference this column. I'm not sure if that
           actually solves your problem.                - rory
        \_ yes, have your keys be drawn from a sequence table. In Oracle,
                you can do this with a sequence object. Do a search on
                google.
        \_ my irrelevant orig. solution deleted... mis-read the question.
        \_ In the oracle world this is called a sequence number. You create
           them like so: "create sequence someIdSeq start with 7070"
           You create new ids this way: select someIdSeq.nextval from dual;
           \_ i'm not sure if that's the situation. The way it was
              described seemed more like a foreign key, but I don't
              understand the need for that unique id.  Actually,
              sequences aren't unique to Oracle; they're standard
              SQL (or that's what the ANSI group says).  Naturally
              fuckers like MySQL won't support it.  Anyway...
              \_ Hence the oracle qualification. But you're right about
                 the standard SQL part.
              \_ I m sure there's a way, but why would you want to do that?
                 If you use natural numbers, you can't do much with the entries.
                 If you combined all the keys to create a unique ID,
                 the key will be very very very long. Waste of space.
                 Might as well stick with unique key of the table.
                 (whatever it's called)
                 Can't remember much from Oracle class. Ugh.    -- ivy
                 whatever it's called   Can't remember much from DB class.
                 Ugh.                                           -- ivy
                 \_ primary key?
2025/05/24 [General] UID:1000 Activity:popular
5/24    

You may also be interested in these entries...
2011/12/29-2012/2/6 [Computer/SW/Database] UID:54274 Activity:nil
12/29   Is it worthwhile to use ext4 on VMs? Is Journaling necessary on VMs?
         \_ what about DBs?  I read somewhere ext3 was better for DB voumes (mysql)
	...
2009/9/23-10/5 [Computer/SW/Database] UID:53392 Activity:nil
9/23    I never took CS188, is there a good book that's an intro to formal
        database theory, normalization, etc.?  I've got experience with SQL
        (MySQL & MSSQL), and understand tables, etc.
        \_ You mean CS186?
           \_ Oops, yah.  188 is AI or something?
              \_ That's right.
	...
2008/4/29-5/5 [Computer/SW/Languages/Perl, Computer/SW/Languages/Python] UID:49852 Activity:moderate
4/29    Scaling your web app in the real world:
        http://teddziuba.com/2008/04/im-going-to-scale-my-foot-up-y.html
        \_ This article is crap.  While yes, 99.9% of all websites don't
           need any serious scalability plans, if any of them become worth
           anything they will need to scale.  If you write a web application
           without careing about scalability you are writing a webapp that can
	...
2006/4/6-7 [Computer/SW/Database] UID:42713 Activity:kinda low
4/6     mysql expert, I've created a db with mixed innodb and isam tables.
        The isam tables have *.MYD and *.MYI (data and index). However the
        innodb tables only have a small *.FRM file. Copying isam tables
        works (when your db is shutdown) but it's not true with innodb.
        Where is the actual data and index located for innodb and how
        do you copy them? Thanks.
	...
2006/3/25-26 [Computer/SW/OS/FreeBSD] UID:42421 Activity:very high
3/24    Wow!  FreeBSD sure is stable!  After seeing soda's amazing uptime
        record, I sure want to go replace my Linux boxes with FreeBSD!
        Please do not delete this, or burn down Linus' house because I have
        blasphemed the holy FreeBSD.  I'd love to see a genuine discussion with
        examples from both sides comparing the stability of *modern* FreeBSD
        and Linux machines running on x86 hardware. -dans
	...
2006/3/14-16 [Computer/SW/Database] UID:42233 Activity:nil
3/14    Hello Oracle experts. Is there a reason why .getProcedures takes
        so long to execute? I've tried using different jdbc connectors
        from different vendors and have the same results, so I think
        it must be the DB hog backend. Why does it take so long?
        try{
          DatabaseMetaData dbmeta  = con.getMetaData();
	...
2006/2/16-17 [Computer/SW/Languages/Web] UID:41887 Activity:nil
2/16    In PHP, If I loop $result=mysql_query("...SQL here..."); with
        a lot of results, while reusing the variable
        $result without ever using mysql_free_result($result),
        would that make the memory space blow up? Like:
        while (1) {
          $result=mysql_query("...SQL HERE...");
	...
2005/7/22-25 [Computer/SW/Database] UID:38784 Activity:nil
7/22    I never took a formal DB theory class, excuse me for asking SQL
        questions. When I create a table, I can choose PRIMARY KEY to be
        based on a single or n-tuple column. When I do that, are indices
        created automatically? Second question is, if the indices are
        created for n-tuple, does that mean all the column have fast
        index, or they are all based on previous columns? For example, if
	...
2005/7/22-25 [Computer/SW/Database, Computer/SW/Languages/Misc] UID:38783 Activity:kinda low
7/22    When I do SELECT AVG(col) FROM table, where col is integer, it takes
        2 minutes and returns a float type. I'm suspecting part of the
        problem is that it's doing floating point add? How do I make it
        faster? Thanks.
        \_ How many rows it is querying over?
           \_ about ~2,000,000
	...
2005/4/8-10 [Computer/SW/Database] UID:37118 Activity:moderate
4/8     Anyone reccomend a good mysql programming tutorial that goes
        beyond the basic select statements ? I would like to be able
        to do a distinct on specific column and then do a count of all
        the rows that have the corresponding values. thanks  --ramberg
        \_ select t.col, count(*) from tble t group by t.col;
           \_ thanks. --ramberg
	...