sql - How do you keep a JOIN table performant? -


i'm drawing plans few new features on site, , 1 "solved" using join table.

example schema:

person table

  • pk personid
  • name
  • age ...

personcheckin table

  • pk fk personid
  • pk fk checkinid
  • date ...

checkin table

  • pk checkinid
  • checkedinto ...

a join run check in data person (connected personcheckin table). since every person check in unlimited number of times, personcheckin table become large.

i'd imagine cause performance issues. typical ways handled keep performance high?

a join considering best performing means of connecting related tables.
depends on query, because might not need join -- joining can inflate record set on parent tables side if there more 1 child record related, means there need either group or distinct. exists or in better choice in such situations...

indexes can on column(s) used in join criteria, on both sides of relationship. in example both sides primary keys, typically have best index automatically created when primary key defined...


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -