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

  • Home
  • SEARCH
  • 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 6606937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:26:56+00:00 2026-05-25T19:26:56+00:00

Is there a way to have one table that is split in two, or

  • 0

Is there a way to have one table that is split in two, or partitioned like a hard drive, so that I can call

SELECT * FROM email validated

or

SELECT * FROM email pending

and get two different results. Both results not containing the other’s rows.

is this something. I feel like I read about mysql partitioning somewhere, a long time ago, and I was wondering if that is what this is. If not, is this possible.

  • 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-25T19:26:56+00:00Added an answer on May 25, 2026 at 7:26 pm

    MySQL supports a virtual table known as a VIEW. A VIEW is effectively a stored MySQL query that can be queried as though it were a real table.

    Using the example you provide, you would create a base table called email, as follows:

    CREATE TABLE `email` (
                `email` VARCHAR(64) NOT NULL,
                `validated` CHAR(1) NOT NULL DEFAULT '0',
                PRIMARY KEY (`email`))
                ENGINE = MyISAM;
    

    and then two virtual tables (VIEWS), as follows:

    CREATE VIEW `email_validated` AS SELECT * FROM `email` WHERE `validated`='1';
    CREATE VIEW `email_pending` AS SELECT * FROM `email` WHERE `validated`='0';
    

    You can then query both of the views as though they were actual tables.

    Recognize, however, that using views contains a performance penalty in that the entire view is queried (the entire select statement for the view is executed) whenever the view is referenced. On an example as trivial as this, it won’t be a big deal provided the ‘validated’ field is indexed in the base table. On a more complicated view, however, it may not make sense to load the entire view virtual table into memory when only trying to retrieve a few rows.

    Other database engines have a structure called a Materialized View, which is the same thing as a MySQL view, excepting that the materialized view exists as a realized table updated at some frequency or trigger. Any operation that can be done to a real table can be done to a materialized table, including changing indexes or even storage engines. It is completely reasonable to have a transaction history using an Archive storage engine while maintaining a roll-up summary table materialized view using a Memory storage engine. Although MySQL does not natively support Materialized Views, there are tricks to mimic the behavior of Materialized Views.

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

Sidebar

Related Questions

Is there any way to have this: [one[two]][three] And extract this with a regex?
Is there any way I can combine list of expressions into one? I have
Is there any way to have something that looks just like a file on
I have one table with 2 columns that i essentially want to split into
Is there a way to have the callback of one AJAX trigger another AJAX
In Team Foundation Server is there a way to have work items in one
Is there a way in Python, to have more than one constructor or more
Is there a way to have a mutable static variable in F# class that
I have a table that looks somewhat like this: CREATE TABLE foobar ( id
I have a table that contains file paths, like so: -------------------- |Files | --------------------

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.