Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6942089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:58:13+00:00 2026-05-27T12:58:13+00:00

I wanted to ask if View are really worth using. From my understanding a

  • 0

I wanted to ask if View are really worth using.

From my understanding a view is really just a query and each time you query the view the view then runs its own query again to get fresh/uptodate data.

This sounds to me like 2 queries are run.
wouldn’t it be faster to just run the query required and skip the view?

Please note: I would be using simple views but even it they were quite complex I assume the same principle applies.

My type of view – say 3 tables with 6 columns each – and 2 columns of each time is added into the view with a couple of maths equations to refine the data a touch.

What do others do? Skip or use them?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:58:14+00:00Added an answer on May 27, 2026 at 12:58 pm

    You’re correct that views are not designed to be a performance benefit in MySQL.

    What they are designed to do is make other queries built on them to be simpler to read, and to make sure that other users and programmers have a better chance at using the data correctly. Think of them as a way to virtually de-normalize the data without taking the size/performance hit of actually de-normalizing the data.

    Just as the most simple case, let’s just take orders and line items. Each order has a line item.

    The orders table might have the following columns:

    ID
    Status
    Created_at
    Paid_on
    

    And the line_items table might have the following columns:

    LI_ID
    order_id
    sku_id
    quantity
    price
    

    What you’ll find, when writing code and queries is that you are going to be doing the following join all the time –

    orders 
      join line_items on line_items.order_id = orders.id
    

    This could be simplified by creating a view:

    create view 'order_lines' as 
    select * from orders
      join line_items on line_items.order_id = orders.id
    

    So your query would go from:

    select orders.id, sum(price) from orders
      join line_items on line_items.order_id = orders.id
      where created_at >= '2011-12-01' and created_at < '2012-01-01
      group by orders.id;
    

    to:

    select id, sum(price) from order_lines
      where created_at >= '2011-12-01' and created_at < '2012-01-01
      group by id;
    

    The DB will execute both of these exactly the same way, but one is easier to read. Admittedly in this case, not MUCH easier to read, but easier to read and code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to ask, why does the response from a ajax request using the
I just wanted to ask is there an easier way to get records from
Just wanted to ask if there is any advantage for either using mouse click
Update2: What I really wanted to ask was already argued in a different page.
Just wanted to ask to how is User management and Page access based on
I wanted to ask if anyone knows how to move map from one div
Hi im new to Android and just wanted to ask if there is a
I wanted to ask if anyone has tried using combination of Sencha's ExtJS 4
i just wanted to ask if there is a way the reject all changes
Just wanted to stop by and ask if anybody has had this problem. I’m

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.