On 5/22/08, Farzana <[EMAIL PROTECTED]> wrote:
>
>  Dear All,
>
>  We have a table named Brand(data is not ordered by Branddescription) where
>  BrandDescription is one of the column and we tried to copy the Brand with
>  the same stucture with the table name Brand_temp and inserted the data
>  ordered by BrandDescription into a temp table  as follows:
>  CREATE TABLE Brand_temp AS SELECT * FROM Brand WHERE 1=2
>  insert into Brand_temp select * from brand order by branddescription
>
>  Then we dropped the Brand table and renamed the temp table as brand like as
>  follows:
>  Drop table Brand
>  ALTER table brand_temp RENAME TO Brand
>
>  When we tried with the original Brand Table in the application it is taking
>  around 15 minutes to fetch the record. But when we use the temp table it's
>  taking 11 secs to fetch the record.
>  We are not clear why there is a drastic change in fetching the records since
>  the structure remains the same and we are using the same application for
>  fetching the records from both the table.
>


Do you, did you have an INDEX on TABLE Brand (BrandDescription)?

If you did, it would get whacked when you DROP the TABLE Brand and
ALTER RENAME Brand_Temp to Brand.

Rebuild the INDEX and then see what the performance is like.


>  Kindly clarify us in this regard.
>  Thanks in advance.
>
>  Regards,
>  Farzana.
>
>
>
>  --
>  View this message in context: 
> http://www.nabble.com/Fetching-records-from-Temp-table-tp17399000p17399000.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
>


-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/
Open Source Geospatial Foundation (OSGeo) http://www.osgeo.org/
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to