Results 1 to 21 of 21

Thread: SQL query to join multiple tables

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator Bok's Avatar
    Join Date
    Oct 2003
    Location
    Wake Forest, North Carolina, United States
    Posts
    24,500
    Blog Entries
    13
    I'd bet >90% is on the filesort in either case and it may well be skewed once it's in the query cache.

    12 secs is pretty decent for 5M rows anyway.

  2. #2
    Quote Originally Posted by Bok View Post
    I'd bet >90% is on the filesort in either case and it may well be skewed once it's in the query cache.

    12 secs is pretty decent for 5M rows anyway.
    I have query caching disabled but yes 12 secs is pretty decent. For fun I took out the UNION and timed the two SELECT statements separately.

    SELECT1 = 4.672 sec
    SELECT2 = 3.469 sec
    TOTAL = 8.141 sec

    Of course you can't really do that since the second SELECT by itself returns the same number of rows as the first most of which is duplicated. But it looks like the UNION part takes 4 seconds.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •