Results 1 to 6 of 6

Thread: fast search + QThread

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: fast search + QThread

    the size of my book in sqlite is larger than 15 gig !
    So?
    is it goode way to store all books in one table ?
    They're all in the one Sqlite file already aren't they? Sqlite will have no issue with a single table of that size: the default database limits are typically 1 billion 1k pages and a table can use all that.
    also i want to use regexp faction in query and i don't think fts can do that .
    Your examples doesn't show that you wanted to use a regular expression. Sqlite doesn't have a regular expression matching ability by default; you have to provide an implementation of that yourself. See http://stackoverflow.com/questions/5...a-sqlite-query.

    FTS has a boolean search language that's quite capable but only you know your actual requirement. You still benefit from only executing one query rather than 20000 either way.


    Line 12 of your example is a select returning the count(*) aggregate without grouping of any sort. This will always return one row and only one row, but you have a limit clause.

  2. #2
    Join Date
    Nov 2010
    Posts
    30
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    3

    Default Re: fast search + QThread

    thanks..

    They're all in the one Sqlite file already aren't they? Sqlite will have no issue with a single table of that size: the default database limits are typically 1 billion 1k pages and a table can use all that.
    i tested but this error returned :
    Qt Code:
    1. database disk image is malformed
    To copy to clipboard, switch view to plain text mode 

    Your examples doesn't show that you wanted to use a regular expression. Sqlite doesn't have a regular expression matching ability by default; you have to provide an implementation of that yourself. See http://stackoverflow.com/questions/5...a-sqlite-query.
    i know Sqlite doesn't have a regular expression by default
    i enabled it by myself

    Qt Code:
    1. QString query = QString("Select count(id) From b%1 Where text REGEXP '%%2%' Limit 0,1 ; ").arg(bookTables.at(rowBook)).arg(searchPatterned);
    To copy to clipboard, switch view to plain text mode 

    Line 12 of your example is a select returning the count(*) aggregate without grouping of any sort. This will always return one row and only one row, but you have a limit clause.
    i don't want to show all result in each book
    but just find that matched book name and count of result
    then by clicking in book list find all result of selected book :
    QString("Select text,page From b%1 Where text REGEXP '%2' ; ").arg(item->data(12).toString()).arg(searchPatterned);

Similar Threads

  1. Replies: 1
    Last Post: 14th November 2012, 22:00
  2. Replies: 1
    Last Post: 4th October 2012, 15:49
  3. Fast QList search/access
    By tryinghard in forum Newbie
    Replies: 4
    Last Post: 15th January 2011, 03:00
  4. Qt3 more fast than Qt4 ?
    By commarmi in forum Qt Programming
    Replies: 11
    Last Post: 14th September 2007, 15:36
  5. Fast Keyboard, help !
    By Alex63 in forum Qt Programming
    Replies: 2
    Last Post: 27th June 2006, 19:18

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.