If you tear apart one of the linestrings to compare and test if the vertexpoints is within some distance from the other linestring to compare you can control the test in many ways.
those examples work in PostGIS (who could guess)
First, if we say that there is a match if all vertex points in a linestring in table_1 is 0.5 meters (map units) or closer to a linestring in table_2:
SELECT a.id, b.id FROM
(SELECT ST_NPoints(the_geom) as num_of_points,
(ST_Dumppoints(the_geom)).geom as p, id FROM table_1) a
INNER JOIN
table_2 b
ON ST_DWithin(a.p, b.the_geom, 0.5) GROUP BY a.id, b.id
HAVING COUNT(*)=num_of_points;
Then we can say that there is a match if more than 60% of the vertex_points in a linestring in table_1 is within distance of a linestring in table_2
SELECT a.id, b.id FROM
(SELECT ST_NPoints(the_geom) as num_of_points,
(ST_Dumppoints(the_geom)).geom as p, id FROM table_1) a
INNER JOIN
table_2 b
ON ST_DWithin(a.p, b.the_geom, 0.5) GROUP BY a.id, b.id
HAVING COUNT(b.id)/num_of_points::float > 0.6
Or we can accept that one point is not in range:
SELECT a.id, b.id FROM
(SELECT ST_NPoints(the_geom) as num_of_points,
(ST_Dumppoints(the_geom)).geom as p, id FROM table_1) a
INNER JOIN
table_2 b
ON ST_DWithin(a.p, b.the_geom, 0.5) GROUP BY a.id, b.id
HAVING COUNT(b.id)-num_of_points <= 1;
You will also have to run the query with table_1 and table_2 in reversed roles.
I don't know how fast it will be. ST_Dumppoints is currently a sql-function in PostGIS and not a C-function which makes it slower than it should have to be. But I think it will be quite fast anyway.
Spatial indexes will help a lot for ST_Dwithin to effective.