Views & nested queries vs joins

This is a discussion on Views & nested queries vs joins within the MySQL Database forums, part of the Database Forums category; While I know that in a regular query a JOIN is more expensive than a nested query, is the same ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-25-2008
Logos
 
Posts: n/a
Default Views & nested queries vs joins

While I know that in a regular query a JOIN is more expensive than a
nested query, is the same true of the query that comprises a view?

I could experiment and find out, but performance measurements are
still a bit of an unknown for me...was hoping someone might have an
off the cuff answer :)

Tyler
Reply With Quote
  #2 (permalink)  
Old 04-26-2008
Rik Wasmus
 
Posts: n/a
Default Re: Views & nested queries vs joins

On Fri, 25 Apr 2008 23:45:46 +0200, Logos <tyler.style@gmail.com> wrote:

> While I know that in a regular query a JOIN is more expensive than a
> nested query,


Whivh is untrue.... It depends on circumstance, and usually the JOIN is
less 'expensive'.

> is the same true of the query that comprises a view?


Erm, it's nice to have a view of often accessed and seldomly changed data.

> I could experiment and find out, but performance measurements are
> still a bit of an unknown for me...was hoping someone might have an
> off the cuff answer :)


Give us some real example to give an educated answer. but performance is
sometimes quite tricky, and dependant on a lot of variables.
--
Rik Wasmus
Reply With Quote
  #3 (permalink)  
Old 04-26-2008
Paul Lautman
 
Posts: n/a
Default Re: Views & nested queries vs joins

Logos wrote:
> While I know that in a regular query a JOIN is more expensive than a
> nested query,

What you "know" is in fact wrong. It it almost ALWAYS the other way round.


Reply With Quote
  #4 (permalink)  
Old 04-27-2008
Logos
 
Posts: n/a
Default Re: Views & nested queries vs joins

On Apr 26, 3:28 am, "Paul Lautman" <paul.laut...@btinternet.com>
wrote:
> Logos wrote:
> > While I know that in a regular query a JOIN is more expensive than a
> > nested query,

>
> What you "know" is in fact wrong. It it almost ALWAYS the other way round.


I seem to be reading a fair number of articles which seem to
contradict each other on this...blah. Back in the day (wow, 10yrs
ago!) I recall being taught that joins were more expensive than
subqueries. Things seem to be more confusing now :P

Perhaps to sum things up more succintly for my question: Are the
queries comprising views handled any differently than a normal query?

Tyler
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:36 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0