in reply to Re: Version Control in Database Applications
in thread Version Control in Database Applications
andSELECT * FROM tablename WHERE key = 12345 ORDER BY version;
The first most likely will get to use an index on key (especially if you build the index with key first and version second) and the second is most likely a table scan. Here are the singleton selects for the current versionSELECT * FROM tablename WHERE key LIKE '12345,%' ORDER BY key;
vs.SELECT * FROM tablename o WHERE key = ? AND version = ( SELECT max(version) FROM tablename i WHERE i.key = o.key )
SELECT * FROM tablename WHERE key = ( SELECT max(key) FROM tablename WHERE key LIKE '$key,%' )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Version Control in Database Applications
by samtregar (Abbot) on Jun 10, 2002 at 20:20 UTC | |
by perrin (Chancellor) on Jun 11, 2002 at 01:18 UTC | |
by samtregar (Abbot) on Jun 11, 2002 at 02:23 UTC | |
by perrin (Chancellor) on Jun 11, 2002 at 03:18 UTC | |
by samtregar (Abbot) on Jun 11, 2002 at 05:03 UTC | |
|