On Sun, Jan 1, 2012 at 8:12 PM, Simon Slavin <slav...@bigfraud.org> wrote:
> > On 1 Jan 2012, at 5:27pm, Baruch Burstein wrote: > > > I need a file format to hold a bunch of resources for my program. I > thought > > of using SQLite. However, I am debating two formats. The > > more convenient one for me would put every few resources in > > a separate table. However, this would result in small tables. Am I right > > that this is very inefficient in SQLite? The other option would be to > put a > > bunch of unrelated resources in one table. Is this more efficient? > > First, don't worry about inefficient. What you need to worry about is > not-efficient-enough. For instance, your app taking 1/10th of a second > slower is not a problem, but if your app becomes too slow to be fun to use, > that's a problem. > > By inefficient I meant space-wise, not time-wise. > A reason to split resources up into many tables would be that each > resource has different columns and you need to do cross-column searches. > Is this what you have ? > > If instead you just have different types of resource, just make another > column in your table and put the thing you'd expected to be the table name > in that column. > > My resources are a bunch of sound and image files, level data files, script files and other game data stuff. Instead of distributing my game with about 20-30 small (some very small) files, I thought I would roll all the files into some kind of archive. I started to roll my own format, when it occurred to me that sqlite may be well suited for this. Which brought me to wonder if storing 5-10 tables with some of them having <500 bytes of data may be very inefficient. I don't want to substitute a 20K file for my <10K of files. I know this is not a lot, but it still bothers me, like what when I have a game with 500M of files? (you never know, it may happen!). No searching is needed (except once for the key to load a resource) -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users