On 2014/06/30 10:30, Hadashi, Rinat wrote:
I work with a very big table, on Linux.
I fail to create index getting the following error:
SQL error near line 1: database or disk is full

Any advice?

Hi Rinat - I was going to simply say "Get a bigger harddrive?" with a smile attached. Obviously you have already established that your Hard drive is in fact not full, so let me try a more useful approach....

When you create a new Index it requires a lot of extra space, both for the Index itself and the process of making the Index with sorting, possibly uniqueness checking and the like. We cannot tell you exactly how much memory is needed because nobody knows since it depends very much on the data shape and size in the table and column for which you are making an Index - all I can say with reasonable certainty is that it typically requires a lot of space - very much in proportion to the size of the full DB, but the exact proportion depends on the data.

To elaborate, it is possible for an index and process of creating an index to require as little as 10% of the full DB size (typically for a table where the data is very wide, not many rows but lots of columns with lots of fat data), and it might require almost double the size of the original DB (on top of the actual DB's filesize) to create and store the Index initially if the data is thin, 2 or 3 columns containing millions of rows with little data per row, such as a logger.

if however you have more than double the free space on your drive (let's say 1GB data file and you have 2GB+ free space) then I would start to look elsewhere for a problem. It is hard to conceive an Index creation using more than that, I think a hard upper limit % do exist but maybe someone else here might know exactly as I don't.

In most flavours of Linux though, you can just "grow" a volume onto some other attached drive and then release space again afterwards - which might solve your problem. (Backup data before attempting this) - a discussion on that is probably not suitable to this forum but a simple google will get you all kinds of instructions in this regard.

Cheers!
Ryan
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to