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 5997305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:14:40+00:00 2026-05-23T00:14:40+00:00

i had a large databse and had to chec if a email is in

  • 0

i had a large databse and had to chec if a email is in a special group
I had to tables.

first tabel called user

CREATE TABLE user (
  uid int(10) NOT NULL AUTO_INCREMENT,
  kid int(3) NOT NULL,
  Email varchar(255) DEFAULT NULL,  
  PRIMARY KEY (uid),
  KEY kid (kid)
) ENGINE=MyISAM

and a table named group

CREATE TABLE `group` (
  `vuid` int(10) NOT NULL AUTO_INCREMENT,
  `uid` int(3) NOT NULL,
  `vid` int(3) NOT NULL,
  PRIMARY KEY (`vuid`)
) ENGINE=MyISAM 

and for every insert i had a defined vid and a email
Now i had to check, if a user with the uid is in the group vid.

select a.email,b.vuid from user a, group b where a.email=\''.$email.'\' and a.kid=' . $kid.' and b.vid=' . $vid . ' and a.uid = b.uid limit 1')

and check if the mysql_fetch_assoc is true or false.

BUT this is verry verry slow. is there a simple way to speed up ?

  • 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-23T00:14:41+00:00Added an answer on May 23, 2026 at 12:14 am

    Rather than using a comma separated list of tables, try using a JOIN (in this case, INNER JOIN is your best bet since you want to check if records exist in both tables) with an ON clause. I have formatted your query and my changes are in capitals to make them stand out.

    select 
        a.email,
        b.vuid 
    from 
        user a
        INNER JOIN group b 
            ON a.uid = b.uid
    where 
        a.email=\''.$email.'\' 
        and a.kid=' . $kid.' 
        and b.vid=' . $vid . ' 
    limit 1
    

    Next, check your indexes – make sure you have indexes on b.uid and a.kid. As a general rule, check your where clauses for values you can index; anything with unique values is a candidate.

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

Sidebar

Related Questions

Has anyone had luck with removing large amount of issues from a jira database
I had a large Silverlight project with an unwieldy web.config, which used transforms against
I recently resolved an issue my VB6 application had when saving large binary objects
I had some pseudoclasses that shared a large part of their initialization. I decided
I had cause to need a label with a large font on a Delphi
Has anyone had any experiences developing large Java applications using GNU gettext for internationalization?
I had an application for returning closest matches to certain values in a large
In my experience I have only had 2 patterns work for large-scale desktop application
I'm currently working on a large and old C++ application that has had many
ORIGINAL Q: I'm wondering if anyone has had experience of migrating a large Cobol/PL1

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.