Jump to content

increase speed of database by creating smaller table.


hamdi123

Recommended Posts

Okay hello everyone.

i have two question

Question 1

-----------

i need help with sql code to increase speed of database by creating smaller table.

i have a database with two tables each table with over 100,000 rows

1. ques

2. answers

i need to select from these big table and insert to another smaller table that is categorized.

i know i can select by categories using

SELECT * FROM ques WHERE category = 'some category'

but how can i select and insert the result to another table?

 

Question 2

----------

after above code completed i need to select from table 'answers' that matches table 'ques' index ID

compare table ques and column queid to table 'answers' and column 'queid'

something like this - but working version of it

 

SELECT * FROM answers where ques.queid = answers.queid

then insert the result of table 'answers' to another smaller table that i created

Link to comment
Share on other sites

Let's step back a bit, 100,000 records is hardly anything. I have worked on a trillion record database.

 

If it is working slow, it is due to not enough memory or no index on what you are searching. You should fix that first. You should be in 40 million records and above before you have to get good at tuning.

 

Indexing is a way that you create a smaller table when you think of it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.