Hi List, I want to make this query faster, for this, i created indexes for Entity_Id and grpuid and also used a pragmas : PRAGMA journal_mode = MEMORY; PRAGMA synchronous = OFF; PRAGMA temp_store = MEMORY; PRAGMA count_changes = OFF; PRAGMA cache_size = 12000; I also do Begin Transaction and End Transaction, but still i havn't achieved the speed the way i like. My Questions : 1. Am i missing out on anything? 2. Entity_ID is a Primary Integer Key, so is there any need to create an Index for it,as per my understanding,Indexing increases the database size and also the INSERT gets slower ....
Thanks in Advance, Atul Igor Tandetnik wrote: > > Atul_Vaidya wrote: >> Hi, I have three tables, >> 1. Table Entity_xdata containing following fields.... >>> Entity_id|Layer|grpuid| >> >> 2. Table, group_xdata_pipe containing following fields .... >>> grpuid|LNV| >> >> 3. Table group_id_vs_reggappname containing following fields .... >>> grpuid|reggappname| >> >> Now, I need to Fire a query to SQlite where in I get the list of all >> the distinct LNVs. Currently I achieve it by following two query >> commands as follows .... >> SELECT DISTINCT Entity_xData.grpuid from Entity_xdata INNER JOIN >> group_id_vs_regappname ON(Entity_xdata.grpuid = >> group_id_vs_regappname.grpuid AND group_id_vs_regappname.reg_appname = >> 'CPD1') >> I get the grpuids using this command and then i use the grpuids that >> i get from this query, as an input to my next query, something like >> this ... >> >> SELECT DISTINCT Line_Number_View FROM (SELECT grpuid,line_number_view >> FROM group_xdata_pipe WHERE grpuid = '%s' ORDER BY grpuid ASC)ORDER BY >> Line_Number_View ASC",query_result[x]) >> >> My question is >> Is it possible to combine both these querries into one ? > > SELECT DISTINCT Line_Number_View > FROM group_xdata_pipe WHERE grpuid IN ( > SELECT Entity_xData.grpuid > FROM Entity_xdata INNER JOIN group_id_vs_regappname ON ( > Entity_xdata.grpuid = group_id_vs_regappname.grpuid AND > group_id_vs_regappname.reg_appname = 'CPD1') > ) > ORDER BY Line_Number_View ASC; > > Igor Tandetnik > > > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > -- View this message in context: http://www.nabble.com/how-to-Select-using-results-from-other-selects-in-a-single-SQlite-querry-statement---tp25149885p25271121.html Sent from the SQLite mailing list archive at Nabble.com. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users