Click here to Skip to main content
16,006,362 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL Connection Problem! Pin
Richard Deeming6-Jan-03 6:15
mveRichard Deeming6-Jan-03 6:15 
GeneralRe: SQL Connection Problem! Pin
dyerstein6-Jan-03 6:25
dyerstein6-Jan-03 6:25 
GeneralRe: SQL Connection Problem! Pin
leppie6-Jan-03 6:46
leppie6-Jan-03 6:46 
GeneralTable optimization Pin
alex.barylski5-Jan-03 7:39
alex.barylski5-Jan-03 7:39 
GeneralRe: Table optimization Pin
Matt Gullett5-Jan-03 9:54
Matt Gullett5-Jan-03 9:54 
GeneralRe: Table optimization Pin
alex.barylski5-Jan-03 12:54
alex.barylski5-Jan-03 12:54 
GeneralRe: Table optimization Pin
Matt Gullett5-Jan-03 13:11
Matt Gullett5-Jan-03 13:11 
GeneralRe: Table optimization Pin
alex.barylski5-Jan-03 14:27
alex.barylski5-Jan-03 14:27 
Matt Gullett wrote:
The easiest way if you want a 1:1 relationship between auth_users and members is to either use the same PK

I didn't even think of that...thats a great idea...because there will always be that one to one relationship. The solution I was looking for was more optimization than anything, not ease of implementation. Using the above one to one relationship model, is it possible to query only the authentication table ('auth_users') initially using something like:

SELECT * FROM auth_user WHERE user='Test' AND pass='Test'


Ideally I would like to use the PKID of the resultset returned from the above query and somehow use another query to return the associated ('members') table record. It's to my understanding that my default SQL(mySQL) automatically uses indexes on primary keys??? So really whats happeneing when I call the above select statement the record is being being indexed, rather then being located sequentially? I don't know if i'm accurate in thinking this or not.

I wouldn't care so much if the ('auth_users') table was sequentially searched becuz it's small in size. However the members table will be quite large so to have a query sequentially search each record here would be quite redundant. I could just make one query if I stored all this data in one table. Basically I would like to know if the following:

SELECT * FROM auth_users WHERE user='Test' and pass='Test'

and then

pkid = auth_id; // Copy the id from the above result

SELECT * FROM members WHERE pkid = auth_id


would cause the second select statement to use indexing by default so to avoid sequentially iterating records in the members table again. This to me seemed like the optimized approach, seeing how auth_users is a small table, so using it to index the equivilent record in the members table made sense. However i'm rather new at mySQL/SQL so i'm not sure.

I was hoping you could shed some light on this subject for me?

I appreciate all the help so far. Smile | :)

Cheers!

"Two wrongs don't make a right, but three lefts do!" - Alex Barylski Smile | :)
GeneralRe: Table optimization Pin
Matt Gullett5-Jan-03 15:26
Matt Gullett5-Jan-03 15:26 
GeneralRe: Table optimization Pin
alex.barylski5-Jan-03 16:24
alex.barylski5-Jan-03 16:24 
GeneralRe: Table optimization Pin
Matt Gullett5-Jan-03 16:50
Matt Gullett5-Jan-03 16:50 
GeneralRe: Table optimization Pin
alex.barylski5-Jan-03 17:19
alex.barylski5-Jan-03 17:19 
GeneralADO connection object Pin
Shamoon5-Jan-03 7:38
Shamoon5-Jan-03 7:38 
GeneralRe: ADO connection object Pin
Matt Gullett5-Jan-03 9:56
Matt Gullett5-Jan-03 9:56 
GeneralColse RecordSet Pin
Mazdak4-Jan-03 1:50
Mazdak4-Jan-03 1:50 
GeneralRe: Colse RecordSet Pin
David Wulff4-Jan-03 7:48
David Wulff4-Jan-03 7:48 
GeneralRe: Colse RecordSet Pin
Mazdak4-Jan-03 9:04
Mazdak4-Jan-03 9:04 
GeneralMS Access Count Pin
Jassim Rahma1-Jan-03 4:06
Jassim Rahma1-Jan-03 4:06 
GeneralRe: MS Access Count Pin
Roger Wright1-Jan-03 5:37
professionalRoger Wright1-Jan-03 5:37 
GeneralRe: MS Access Count Pin
David Wulff1-Jan-03 5:39
David Wulff1-Jan-03 5:39 
QuestionmySQL, what do you think? Pin
Jassim Rahma1-Jan-03 4:02
Jassim Rahma1-Jan-03 4:02 
AnswerRe: mySQL, what do you think? Pin
Douglas Troy1-Jan-03 5:48
Douglas Troy1-Jan-03 5:48 
GeneralRe: mySQL, what do you think? Pin
Jassim Rahma1-Jan-03 11:19
Jassim Rahma1-Jan-03 11:19 
GeneralRe: mySQL, what do you think? Pin
perlmunger6-Jan-03 13:41
perlmunger6-Jan-03 13:41 
AnswerRe: mySQL, what do you think? Pin
Rob Graham1-Jan-03 6:12
Rob Graham1-Jan-03 6:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.