| 
			
			 | 
		#1 | 
| 
			
			
			
			 Chalut o/ 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 486 
				Karma: 678910 
				Join Date: Dec 2017 
				
				
				
				Device: Kobo 
				
				
				 | 
	
	
	
		
		
			
			 
				
				[Feature suggest] Maintenance option: Reindexed the library
			 
			
			
			First one, a trivial question: 
		
	
		
		
		
		
		
		
		
		
		
		
	
	What is the theoretical limit of the library index? I guess that's an unattainable number, but I'm curious The thread question: Would it be possible to make an option of maintenance of the library which allows to re-index the books and to fill the possible voids in the numbering? So, Yes, I know this is a very delicate operation. The user interface must ther be frozen to prevent any library modification during the process. But as the operation can be very long, it would be necessary to leave a button "Stop reindexing". Once this button is clicked, Calibre finishes the current book then release the user control. _____________ Currently, when a book is added, Calibre gives it "last index+1". It is a simple solution, fast and without headache. I'm nothing against it, and it would be monstrously and unnecessarily complicated to test the free indexes when adding a book (and slowed Calibre) But, a separate maintenance option, why not.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,686 
				Karma: 12595249 
				Join Date: Jun 2009 
				Location: Madrid, Spain 
				
				
				Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			As somebody who comes from the software world, unless you reach the limit of the index (maximum number allowed by the size of the field), it doesn't make sense for me
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#3 | 
| 
			
			
			
			 Deviser 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,265 
				Karma: 2090983 
				Join Date: Aug 2013 
				Location: Texas 
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Good joke.  Very funny.  It makes me smile.   Have a nice day.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#4 | 
| 
			
			
			
			 Chalut o/ 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 486 
				Karma: 678910 
				Join Date: Dec 2017 
				
				
				
				Device: Kobo 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#5 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,686 
				Karma: 12595249 
				Join Date: Jun 2009 
				Location: Madrid, Spain 
				
				
				Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#6 | 
| 
			
			
			
			 Handy Elephant 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,737 
				Karma: 26785684 
				Join Date: Dec 2009 
				Location: Southern Sweden, far out in the quiet woods 
				
				
				Device: Samsung Galaxy Tab S8 Ultra 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			The procedure is: (not tested...) 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Save all your books to disk, making sure to save covers and complete updated metadata in opf:s. Create a new empty calibre library, with the same structure as the old. Import all the saved books to the new library, reading metadata from OPF:s. Enjoy lovely low index numbers without gaps. For a while... Test first on a small representative subset of books... ![]() It is essentially a database dump and restore from dump. I remember when that was the usual way to speed up and compact databases...  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#7 | |
| 
			
			
			
			 Well trained by Cats 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,267 
				Karma: 61916422 
				Join Date: Aug 2009 
				Location: The Central Coast of California 
				
				
				Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 OTOH Doing the Copy To Library gives the book a new assignment (and is not susceptible to orphans) as part of the task. If the destination starte empty, they will be sequential  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#8 | 
| 
			
			
			
			 null operator (he/him) 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,018 
				Karma: 30277294 
				Join Date: Mar 2012 
				Location: Sydney Australia 
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			@un_pogaz - why do you care? 
		
	
		
		
		
		
		
		
		
		
		
		
	
	BR  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#9 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			There's never going to be such a feature. book ids are meant to be stable, they are for instance, used in content server urls. You can of course do it yourself by using various tricks such as copy to library to a new library, but I strongly recommend against it.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#10 | 
| 
			
			
			
			 Chalut o/ 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 486 
				Karma: 678910 
				Join Date: Dec 2017 
				
				
				
				Device: Kobo 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			@BetterRed Why not ? More precisely, I see my library growing more and more, I am not worried, but just curious. 
		
	
		
		
		
		
		
		
		
		
		
		
		
			@Adoby Nope,I don't recommend this method. The best is what Kovid suggests: Move your library in a another via Calibre. Use "Save to disk" would be doubly longer (writing then adding) and uncertain. @kovidgoyal Yes, it is an easy solution that has the merit of already being implemented. However, it has a flaw: The "Move books" function copies all books and deletes all books only if the operation ends normally. If the operation is interrupted, even via the button designed for, the books already copied are not deleted from the source library. Result, duplicates between the 2 libraries. A mass move (Select all > Move to library) is such an enormous risk that it makes it impossible. So you stay in front of Calibre and move your library, 100 by 100 (for exemple), manually. One solution would be to copy the books and delete them 1 by 1, gradually. This might be slower than the current method, but it would be a true "Move to library" function. I leave you to judge this change. Thank for answer Last edited by un_pogaz; 06-25-2018 at 12:16 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#11 | 
| 
			
			
			
			 null operator (he/him) 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,018 
				Karma: 30277294 
				Join Date: Mar 2012 
				Location: Sydney Australia 
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			@un_pogaz - why renumber the Books table, and not the other tables with auto incremented primary keys, viz: 
		
	
		
		
			This may be of interest ==>> Implementation Limits For SQLite. BR  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#12 | |
| 
			
			
			
			 Chalut o/ 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 486 
				Karma: 678910 
				Join Date: Dec 2017 
				
				
				
				Device: Kobo 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			From the page Implementation Limits For SQLite  
		
	
		
		
		
		
		
		
		
		
		
		
	
	Quote: 
	
 Hum I think we can rest easy.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#13 | 
| 
			
			
			
			 US Navy, Retired 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,897 
				Karma: 13806776 
				Join Date: Feb 2009 
				Location: North Carolina 
				
				
				Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
    
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Killer Feature I suggest | desk7 | Onyx Boox | 9 | 07-07-2017 03:17 AM | 
| Missing Library/Library Maintenance button | babyshelley | Library Management | 2 | 06-20-2015 02:05 PM | 
| Library Maintenance option missing? | xterminal | Library Management | 3 | 08-27-2012 04:48 PM | 
| Library Maintenance feature removed? | Trickery | Library Management | 1 | 03-04-2011 03:14 PM |