Wednesday, 2 October 2013

select set of ID from large table Fast

select set of ID from large table Fast

pI have large table with ID as primary. about 3 mil row./p pand need to
extract a small set of rows base on given ID list./p pCurrently I am doing
it on where... in but very slow.. like 5 to 10s. /p pcode: select
id,fa,fb,fc from db1.t1 where id
in(15,213,156,321566,13,165,416,132163,6514361,... );/p pI try query one
ID at a time but it is still slow. like select id,fa,fb,fc from db1.t1
where id =25;/p pI also try to use temp table and insert the ID list and
call Join. But no improvement. select id,fa,fb,fc from db1.t1 inner join
db1.temp on t1.id=temp.id/p pIs there any way to make it faster. been
stuck on here for a few days. Thank ahead.. /p

No comments:

Post a Comment