query efficiency question
Hi all, I have two tables containing the following: table1: +--++ | UNID | DATE | +--++ | 08294D5D0F9ABE6D46663300BDB6521C | 2001-09-09 02:00:30| | FF4210F70A19D36856663300BDB6521C | NULL | | FB499B109E1C6E143300BDB6521C | NULL | | 9429E5EC91F7508676663300BDB6521C | NULL | | 578313DA1378F96E86663300BDB6521C | 2001-10-21 02:00:40| ... etc etc table2: +-+--+---+--+ | ID | PO_UNID | CONTENT | PO_DOCID | +-+--+---+--+ | 519 | 08294D5D0F9ABE6D46663300BDB6521C | on| D6EBA9F0D5D49280C1256BDB00336664 | +-+--+---+--+ | 520 | 08294D5D0F9ABE6D46663300BDB6521C | off | DFAEFFFWE33771FSDSF428DSF355 | +-+--+---+--+ My problem is that the following query results in several thousand tupels: SELECT UNID FROM TABLE1 WHERE DATE IS NULL; Therefore I use: SELECT UNID FROM TABLE1 WHERE DATE IS NULL LIMIT 1; Now I want to do the following: SELECT UNID FROM TABLE1 WHERE DATE IS NULL LIMIT 1; SELECT CONTENT FROM TABLE2 WHERE PO_UNID='RESULT PREVIOUS QUERY' Instead of writing two queries this could be written as: mysql select 0.UNID, c.CONTENT - from table1 o, table2 c - where o.DATE IS NULL - and o.UNID = c.PO_UNID - LIMIT 1; This results query gives me the right result but it's execution time takes allmost 6 times longer then the two seperate queries. I'm planning to make these queries in a JAVA program (Using the JDBC-bridge). Which variation is smarter? Using the 2 queries, or using the second variation met the join? Any help would be greatly appreciated. Many Thanks, Harm de Laat Informatiefabriek The Netherlands - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
is it worth to wait for version 4.1?
Hi all, I'm implementing a bridge between MySQL and Lotus Domino. In our application we realy need stored procedures (triggers). I saw that MySQL does not yet support stored procedures. (This will be one of the features of version 4.1). Is it worth to wait for version 4.1 or should we switch to some other database management system like postgresql (which does support stored procedures)? We realy would like to use mysql. Because the Lotus Domino bridge work perfectly with mysql, but it does not realy work with PostgreSQL. Any ideas here? Many Thanks, Harm de Laat Informatiefabriek The Netherlands - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
when will mysql 4.1 be released?
Hi all, I'm implementing a bridge between MySQL and Lotus Domino. In our application we realy need stored procedures (triggers). I saw that MySQL does not yet support stored procedures. (This will be one of the features of version 4.1). Is it worth to wait for version 4.1 or should we switch to some other database management system like postgresql (which does support stored procedures)? We realy would like to use mysql. Because the Lotus Domino bridge work perfectly with mysql, but it does not realy work with PostgreSQL. Any ideas here? Many Thanks, Harm de Laat Informatiefabriek The Netherlands - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: when will mysql 4.1 be released?
First of all, let me apologize for repeaditly sending my e-mail message to the list. Roger Baklund wrote: I don't know. Not in the nearest future, they have just begun the coding. Oka I don't get it... does it work perfectly with mysql, or do you realy need stored procedures? And how come you consider postgresql, when it does not realy work with PostgreSQL? First you should decide if it works or not with mysql. If it does not, you can consider if it works with postgresql. If it does not, you can consider if it is worth waiting for 4.1, or if you should consider other products. The word worth implies some kind of economic considerations, it is hard to answer without the knowledge of your economic situation. How important is this application for you? Can you afford to not make the bridge in 6-12 months? Can you work on other projects in the meanwhile? (6-12 months is just me guessing, I feel safer with Not in the nearest future.) IBM (Vendor of Lotus Domino) provides a Lotus Notes module called DECS which purpose is to provide a 'bridge' to relational databases like MySQL, Sybase and Oracle. (This goes via ODBC) This 'bridge' seems to work fine with MySQL (and it's ODBC driver). But it does not work with postgreSQL (and the postges-ODBC driver). This is a known bug (and IBM is working on it). We could use MySQL and imlement stored procedures outselves. (Using some scriptlanguages like perl or python). But this is (ofcourse) a lot of work. If we could use stored procedures in MySQL that would realy help!. So I read that Mysql 4.1 would have stored procedures. But no release date was mentioned. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Foreign keys in query optimization
Kiss Dániel wrote: I studied the MySQL and InnoDB manual, but I did not find anything about the internal usage of foreign keys. MySQL does not support foreign keys at the moment. This will be implemented in version 4.1. For more info see: http://www.mysql.com/products/mysql-4.0/index.html Cheers, Harm de Laat Informatiefabriek The Netherlands - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php