Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MySQL++ - Programming with the C++ API to MySQL
MaxDB - Everything about MaxDB, formerly known as SAP DB
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
mysql openssl Question
mysql:it 's a db not a dbms how it 's possible?!
Does the binary log enabling affect the MySQL performances?
Strange behavior, Table Level Permission
FULLTEXT query format question
Preventing Duplicate Entries
Comparing and writing out BLOBS
Executing MySQL Commands From Within C Program
Can 't access mysql after kernel upgrade
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Downgrade Mysql from 4 to 3 23
MySQL Cluster Software
mysql test 4 1 fails with the gis test
ERROR 2002: Can 't connect to local MySQL server through socket
Getting Identity after INSERT
Update one field with more fields from another table
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
mysql have same function mthod as Oracle decode()
 
poor join performance

poor join performance

2007-01-29       - By Becker, Holger

 Back
Reply:     1     2  

Eduard M wrote:

> I have a query that does a simple join from 2 tables, on a
> foreign key. Both
> tables are about 1,000,000 rows each. The query takes about
> 11 seconds. It
> seems like way too long.
>
> select kar.id from per_karte kar, per_nodarbosanas nod where nod.id > kar.per
_nodarbosanas_id
>
> The query is executed from SQL Studio.
> If I limit the query to rowno < 500, it executes very fast.
>
> I wonder why the big query takes so long. Is it somehow related to
> transaction isolation level? Is database copying aside any
> temporary data,
> or looking into rollback segment while making that join?
>
> Eduard

Hi,

join selects always creates a result set in MaxDB.

So if in your case each row from one table hits one in the other
you gets a result set with 1 million rows and this might take 11
seconds.

Kind regards
Holger

--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/maxdb?unsub=mysql@(protected)