
19 Cal.App.4th 738 (1993)
23 Cal. Rptr.2d 733
THE PEOPLE, Petitioner,
v.
THE SUPERIOR COURT OF LOS ANGELES COUNTY, Respondent; ISIAIS MARTINEZ et al., Real Parties in Interest.
Docket No. B075272.
Court of Appeals of California, Second District, Division Four.
October 21, 1993.
*741 COUNSEL
Gil Garcetti, District Attorney, Patrick D. Moran and Brentford J. Ferreira, Deputy District Attorneys, for Petitioner.
No appearance for Respondent.
Rand Steven Rubin and Timothy C. Lannen for Real Parties in Interest.
*742 OPINION
VOGEL (C.S.), J.
As to two defendants, the superior court dismissed one count (murder) of a twelve-count multiparty indictment on the ground that prosecution of the murder charge against them is barred by Penal Code section 1387.[1] That section provides that further prosecution of a felony is barred if the action has twice been previously terminated. The People seek a writ of mandate compelling the superior court to vacate this order. We shall issue the writ, concluding that the murder charge has not been twice previously terminated.

PROCEDURAL BACKGROUND
On June 22, 1992, the People filed a complaint (case No. BA060225) in two counts, charging real parties in interest Isiais Martinez and Rubidia Lopez, as well as Jorge Sanchez (not a party to this proceeding), with (1) murder (§ 187), and (2) conspiracy to commit insurance fraud (Ins. Code, former § 1871.1, see now Pen. Code, § 550, subd. (a)(6)).
As required by sections 859b and 738, a preliminary hearing was held on this complaint from September 24 to October 6, 1992. The evidence at the preliminary hearing indicated the defendants staged a vehicle accident for the purpose of defrauding an insurer.
On June 17, 1992, Sanchez drove a Pontiac in which Martinez, Lopez, and the decedent, Jose Luis Perez, were passengers. On the freeway Sanchez repeatedly maneuvered the Pontiac in front of a big rig car carrier, braking and swerving for no apparent reason. The big rig collided with the Pontiac and jacknifed, falling on top of the Pontiac. Perez was killed in the accident.
At the conclusion of the preliminary hearing on October 6, 1992, the magistrate held Sanchez to answer for murder and held all three defendants to answer for conspiracy to commit insurance fraud. (§ 872.) The magistrate concluded, however, that the evidence was insufficient to provide reasonable cause to believe Martinez and Lopez were guilty of murder. (§ 871.)
On October 20, 1992, as permitted by section 739, the People filed an information (still Super. Ct. L.A. County, No. BA060225) charging Sanchez, Martinez, and Lopez with both murder and conspiracy to commit insurance fraud. Sanchez, Martinez, and Lopez were arraigned on this information on October 20, 1992, and pleaded not guilty. Trial setting conference was set for October 30.
*743 Meanwhile, the People were seeking a grand jury indictment (§ 737) covering the entire scope of a scheme by an attorney, his alleged capper, and numerous other persons to stage vehicle accidents for the purpose of insurance fraud. The grand jury returned a 12-count indictment against 30 defendants, alleging insurance fraud, conspiracy to commit insurance fraud, conspiracy to commit grand theft, conspiracy to violate Business and Professions Code section 6152, and murder. Count 9 of the indictment charged murder, based on the June 17 vehicle accident, against Sanchez, Martinez, and Lopez, and also against the attorney and the alleged capper. Count 8 of the indictment charged Sanchez, Martinez, Lopez, the attorney and the alleged capper with insurance fraud for presenting a claim based on the June 17 accident.
On October 30, 1992, the indictment (Super. Ct. L.A. County No. BA066800) was unsealed and presented. (§ 944.) On that date, on the People's motion, the trial court dismissed information No. BA060225 in the interest of justice (§ 1385) and arraigned Sanchez, Martinez, and Lopez on the indictment (No. BA066800).
On the motion of Martinez and Lopez to set aside the indictment, the trial court found the evidence presented to the grand jury provided reasonable cause to try Martinez and Lopez for murder. (§ 995, subd. (a)(1)(B).) Martinez and Lopez thereafter contended, however, that the dismissal of October 30 was a second termination which, pursuant to section 1387, barred further prosecution under the indictment. After a somewhat convoluted procedural history which need not be recounted here, the trial court agreed with Martinez and Lopez that prosecution of them for murder under count 9 of the indictment was barred by section 1387. On May 3, 1993, the court dismissed count 9 of the indictment as to Martinez and Lopez.
(1) The People sought a writ of mandate to compel the superior court to vacate this order, and an immediate stay of the trial of Martinez and Lopez for insurance fraud. We issued an order to show cause and a stay of the trial. Review by extraordinary writ is appropriate. The People's remedy by appeal (§ 1238, subd. (a)(1)) is inadequate because proceeding with trial of Martinez and Lopez for insurance fraud would involve needless duplication of evidence relating to the dismissed murder count if the appeal were ultimately successful. (See People v. Superior Court (Smart) (1986) 179 Cal. App.3d 860, 862 [225 Cal. Rptr. 62].)

DISCUSSION
(2) Subject to numerous exceptions (§§ 1387, 1387.1), the general rule of section 1387 is that "[a]n order terminating an action pursuant to this *744 chapter, or Section ... 871 ... is a bar to any other prosecution for the same offense if it is a felony ... and the action has been previously terminated pursuant to this chapter, or Section ... 871...." (§ 1387, subd. (a).) The basic purpose of this section is to limit improper successive prosecutions which harass a defendant. (People v. Cossio (1977) 76 Cal. App.3d 369, 372 [142 Cal. Rptr. 781]; Lee v. Superior Court (1983) 142 Cal. App.3d 637, 640 [191 Cal. Rptr. 361].) This section is sometimes loosely described as establishing a two-dismissal rule, but by its terms requires two orders "terminating an action." In this case that distinction is significant.
In support of the trial court's order Martinez and Lopez contend (1) the magistrate's order was the first termination, (2) the order dismissing the information under section 1385 was the second termination, barring a "third" prosecution under the indictment, and (3) the prosecution was required to utilize the procedure established in section 871.5. They are wrong on all three grounds.

FIRST TERMINATION
(3) The People may prosecute either by information or by indictment. (§ 737.) Before an information is filed there must be a preliminary examination and an order holding the defendant to answer. The proceeding for a preliminary examination is commenced by a complaint. (§ 738.)
If it appears from the evidence at the preliminary examination that a public offense has been committed and there is sufficient cause to believe the defendant is guilty, the magistrate shall order the defendant held to answer. (§ 872.)
If, on the other hand, it appears from the evidence at the preliminary hearing that no public offense has been committed or that there is no sufficient cause to believe the defendant guilty, the magistrate shall order the complaint dismissed and the defendant discharged. (§ 871.) Even without a formal order of dismissal, the magistrate's decision not to hold the defendant to answer is the equivalent of a section 871 dismissal of the complaint. (Brazell v. Superior Court (1986) 187 Cal. App.3d 795, 800 [232 Cal. Rptr. 246]; In re Williams (1985) 164 Cal. App.3d 979, 983 [211 Cal. Rptr. 32].)
(4) Whether the magistrate's order of dismissal under section 871 is an order terminating the action within the meaning of section 1387 depends on the circumstances.
*745 Because section 1387 allows one previous termination, the People may elect to treat the magistrate's dismissal as a final termination of that (first) action, and start over with a new (second) action. Under this procedure, the People file a new complaint, leading to a new (second) preliminary hearing and a second magistrate's evaluation. (E.g., Ramos v. Superior Court (1982) 32 Cal.3d 26, 29 [184 Cal. Rptr. 622, 648 P.2d 589].)[2] In that situation, the magistrate's order of dismissal of the complaint under section 871 terminates the (first) action. That was not the situation here.
(5) Because the magistrate held Martinez and Lopez to answer on the transactionally related insurance fraud count, section 739 authorized the People to proceed in the same case by filing an information charging Martinez and Lopez "with either the offense or offenses named in the order of commitment or any offense or offenses shown by the evidence taken before the magistrate to have been committed." Under this procedure, there is no second preliminary hearing. The People take the risk whether the magistrate was wrong in evaluating the sufficiency of evidence at the preliminary hearing, and that legal issue is normally tested in superior court by the defendant's motion under section 995 to set aside the information. (People v. Slaughter (1984) 35 Cal.3d 629, 633 [200 Cal. Rptr. 448, 677 P.2d 854]; People v. Superior Court (Jurado) (1992) 4 Cal. App.4th 1217, 1225-1226 [6 Cal. Rptr.2d 242]; People v. Encerti (1982) 130 Cal. App.3d 791, 798 [182 Cal. Rptr. 139]; § 995, subd. (a)(2)(B).)
In such a case, the magistrate's dismissal under section 871 at the preliminary hearing does not terminate the action. The action continues with an information filed under the same case number pursuant to section 739. The action is not terminated at all if the superior court disagrees with the magistrate and denies a section 995 motion based on the evidence produced at the preliminary hearing. The action then proceeds, possibly to conviction. In any event, the action remains alive at least until the superior court agrees with the magistrate's ruling and grants the defendant's section 995 motion. The action is terminated when the superior court dismisses the information pursuant to section 995.
Here, the People used section 739 to file an information with the same case number, taking their chances that the magistrate's section 871 dismissal might be upheld, and the action terminated, upon a motion by Martinez and Lopez to dismiss the information under section 995. But the case never got *746 that far. Instead, the People moved to dismiss the information in the interest of justice (§ 1385) because prosecution of the information was unnecessary in light of the indictment. We hold, contrary to the argument of Martinez and Lopez, that the dismissal under section 1385 was the first termination within the meaning of section 1387, not the second. It follows that the indictment did not commence a third prosecution but only a second, which was not barred by section 1387.
This view, that a magistrate's (first) dismissal under section 871 is not by itself a termination of the action when followed by the filing of an information under section 739, is supported by what was decided, and not decided, in Ramos v. Superior Court, supra, 32 Cal.3d 26, and the legislative response thereto. In Ramos, after a magistrate dismissed a special circumstance allegation at the preliminary hearing, the People filed a new complaint charging the allegation again. A second preliminary hearing was held, following which the second magistrate also dismissed the allegation. (Id. at p. 29.) It was in the context of two separate prosecutions, two preliminary hearings and two magistrate's dismissals for insufficiency of evidence (a paradigm example of successive prosecutions harassing a defendant) that the Supreme Court held further prosecution under section 739 would violate section 1387. (32 Cal.3d at p. 35.) The court was careful to limit its holding to the circumstance of a second magistrate's dismissal order. The court expressly cautioned, "We note that this case does not present the question of the application of section 1387 to a case in which (1) a magistrate dismisses a charge one time under section 871, (2) the prosecution files an information recharging the dismissed matter under section 739, and (3) the superior court dismisses the refiled charge under section 995. Accordingly, we express no view on that issue." (32 Cal.3d at p. 37, fn. 12, italics added.) This comment suggested the possibility that in the posed hypothetical there is only one termination of a single action, not two terminations.
In 1984, after Ramos, the Legislature amended section 1387 (Stats. 1984, ch. 924, § 1, p. 3091) to include the language now found in subdivision (b)(3): "However, if the previous termination was pursuant to Section ... 995, the subsequent order terminating an action is not a bar to prosecution if: [¶] The motion pursuant to Section 995 was granted after dismissal by the magistrate of the action pursuant to Section 871 and was recharged pursuant to Section 739." This amendment suggests the Legislature also considered a magistrate's first section 871 dismissal, followed by refiling under section 739 and the grant of a section 995 dismissal, to constitute parts of a single prosecution, resulting in one termination of an action, not two.
To the extent that In re Williams, supra, 164 Cal. App.3d at pages 981-982, appears to assume the contrary, we decline to follow it. In any event, *747 Williams is distinguishable because the preliminary proceedings there occurred in 1982, before the statute's amendment.
If there had not been an indictment in this case, the magistrate's ruling would have been tested under section 995. Even if that ruling had favored Martinez and Lopez, the section 995 dismissal order would not have barred further prosecution. Further prosecution should not be barred here merely because the information was dismissed in the interest of justice under section 1385 instead of under section 995. The section 1385 dismissal order was the first order terminating the action, not the second.

DISMISSAL IN FAVOR OF INDICTMENT
(6) Even if the magistrate's order under section 871 were treated as a previous terminating order for the purpose of section 1387, the subsequent dismissal under section 1385 in favor of proceeding by indictment did not bar prosecution under the indictment. (People v. Cossio, supra, 76 Cal. App.3d 369; People v. Schlosser (1978) 77 Cal. App.3d 1007 [144 Cal. Rptr. 57]; § 1387, subd. (b).)
In People v. Cossio, supra, 76 Cal. App.3d 369, a (first) complaint was dismissed by the People when the People were not ready to proceed. The People filed a new complaint. Before a preliminary hearing was held on the second complaint, the grand jury returned an indictment. Although the People requested that the proceedings on the complaint be stayed until conclusion of the proceedings on the indictment, the superior court ordered that the complaint be dismissed. The defendant thereafter argued that the two dismissals barred prosecution on the indictment. The appellate court rejected this argument, saying, "In our case, however, the indictment with which we are concerned was returned while the second municipal court complaint was still pending and there was, at that date, only one dismissal by a magistrate. The People urge that that distinction is material and that the subsequent dismissal of the second complaint was merely to clear the court records of what, in light of the return of the indictment, had become an unnecessary proceeding. We agree with that position. The purpose of section 1387 is to prevent improper successive attempts to prosecute a defendant. Where, as here, the proceedings are ready to go forward, on an indictment properly filed, the subsequent dismissal of a complaint involving the same facts does not involve the defendant in the kind of successive prosecutions that section 1387 was designed to prevent. In fact, the proceedings below effectuated, rather than impeded, the statutory objective. Defendant was relieved from the necessity of meeting the same charges in two different courts and was left with one prosecution to answer and defend." (Id. at pp. 371-372.)
*748 In People v. Schlosser, supra, 77 Cal. App.3d 1007, a magistrate dismissed a complaint at the preliminary hearing pursuant to section 1385 after suppressing evidence. A second complaint was filed, defendants were arraigned and proceedings were continued to a certain date. Prior to the continued date, an indictment was returned. On the date originally set for preliminary hearing on the second complaint, the complaint was dismissed and the defendants were arraigned on the indictment. Subsequently, the trial court dismissed on the ground that prosecution was barred by section 1387. The appellate court reversed, saying, "The Attorney General argues that here there was only one prior dismissal of the `action' and that the `action' under the second complaint was never actually dismissed; rather that the district attorney elected to proceed by grand jury indictment as the means to bring defendants to trial. We agree. Dismissal of the complaint ... at the request of the prosecutor due to the return of the indictment, followed immediately ... by arraignment on the indictment, did not constitute a dismissal of the action within the meaning of Penal Code section 1387 as we interpret it in context with its intent and purpose to achieve a speedy trial; the procedure was an orderly, uninterrupted continuation of the prosecution of the action in a most expeditious manner." (77 Cal. App.3d at p. 1011, italics in original.)
In 1984, the Legislature amended section 1387 (Stats. 1984, ch. 924, § 1, p. 3090) to add the language now contained in subdivision (b) that "An order terminating an action is not a bar to prosecution if a complaint is dismissed before the commencement of a preliminary hearing in favor of an indictment filed pursuant to Section 944 and the indictment is based upon the same subject matter as charged in the dismissed complaint, information, or indictment."
The statutory amendment endorsed the results in Cossio and Schlosser. Martinez and Lopez do not directly address Cossio and Schlosser. They merely argue that the instant case does not fit section 1387, subdivision (b), because here there was a preliminary hearing. The poor fit results largely from the artificiality of their argument that the magistrate's order terminated a first action, as discussed ante. If Martinez and Lopez insist on claiming that the magistrate's dismissal terminated a "previous" action, then they must also admit that the preliminary hearing was in such "previous" action; there was no additional preliminary hearing in the action which Martinez and Lopez attempt to characterize as the "second" action. If, instead of refiling under section 739 the People had filed a new complaint, then dismissed it in favor of the indictment before a second preliminary hearing was held, such second dismissal would not under section 1387, subdivision (b) bar further prosecution. (E.g., People v. Schlosser, supra, 77 Cal. App.3d at p. 1009; see *749 also Landrum v. Superior Court (1981) 30 Cal.3d 1, 14 [177 Cal. Rptr. 325, 634 P.2d 352] [after first dismissal for failure to hold preliminary hearing within 10 days, filing of new complaint commences new 10-day period for holding second preliminary hearing].)
The policy and reasoning of Cossio, Schlosser, and section 1387, subdivision (b) are applicable here. The substitution of the indictment for the information was a matter of form rather than substance. Rather than subjecting Martinez and Lopez to successive prosecutions, the substitution relieved them of the burdens of the pending information. As stated in People v. Bohlen (1992) 4 Cal. App.4th 400, 403 [5 Cal. Rptr.2d 670], elimination of duplicative prosecutions is desirable and promotes the purposes of section 1387, and such reality should not be confused amid "semantic procedural distinctions" and "paper gavottes."

SECTION 871.5
(7) Finally, Martinez and Lopez contend that the People could not file an information under section 739 or proceed by indictment but instead were required to use the procedure in section 871.5 to review the magistrate's ruling. This contention is utterly without merit.
Section 871.5 was enacted in 1980 with other legislation concerning the power of magistrates. (See Landrum v. Superior Court, supra, 30 Cal.3d at pp. 5-6, fn. 4 [background of 1980 legislation on powers of magistrates].) It provides a method by which, under certain conditions, the People may seek direct review of a magistrate's dismissal order by filing a motion in superior court to compel the magistrate to reinstate the complaint.
Under the 1980 version of section 871.5, the courts rejected the contention that section 871.5 precluded the People from filing an information under section 739 following a first dismissal by a magistrate. (People v. Encerti, supra, 130 Cal. App.3d at pp. 797-798 [decided Apr. 1982].) In Ramos v. Superior Court, supra (decided Aug. 5, 1982), the Supreme Court stated that "... after a first dismissal by the magistrate, the district attorney may either refile a new complaint, file an information under section 739 charging the dismissed matter..., or  if he wishes to eliminate the effect of the first dismissal for section 1387 purposes  challenge the dismissal directly under section 871.5...." (32 Cal.3d at p. 35, citations and fn. omitted, italics added.) Ramos described section 871.5 primarily as a remedy available to the People after a second dismissal by a magistrate, the condition under which *750 Ramos held the People could not use section 739. (Id. at pp. 36-37; see People v. Mayo (1986) 185 Cal. App.3d 389, 395 [229 Cal. Rptr. 762]; Dunn v. Superior Court (1984) 159 Cal. App.3d 1110, 1116 [206 Cal. Rptr. 242].)
In urgency legislation effective August 28, 1982 (Stats. 1982, ch. 671, §§ 1, 2, pp. 2740-2741), the Legislature revised section 871.5. Under that amendment, as currently, the prosecution may make the motion in superior court to compel the magistrate to reinstate the complaint "[w]hen an action is dismissed by a magistrate pursuant to Section 859b, 861, 871, 1008, 1381, 1381.5, 1385, 1387, or 1389, or a portion thereof is dismissed pursuant to those same sections which may not be charged by information under the provisions of Section 739. ..." (Italics added.)
In the instant matter, the murder charge was transactionally related to the insurance fraud charge which the magistrate did not dismiss. The People could, and did, file an information under section 739 charging both counts. The procedure in section 871.5 was not even available to the People, much less mandatory. The 1982 urgency amendment to section 871.5 makes clear that its remedy is intended for situations in which the People cannot use section 739, for example, (1) the magistrate dismisses all the charges (see People v. Luna (1983) 140 Cal. App.3d 788, 793, fn. 3 [189 Cal. Rptr. 792]); (2) the dismissed and nondismissed counts are not transactionally related (People v. Slaughter, supra, 35 Cal.3d at p. 633); or (3) the magistrate's dismissal is the second dismissal. (Ramos v. Superior Court, supra, 32 Cal.3d at pp. 35-36.)
Martinez and Lopez take out of context the remark in People v. Mimms (1988) 204 Cal. App.3d 471, 481 [251 Cal.Rptr 672], that "... section 871.5 is the exclusive method by which the People may obtain a review of a magistrate's order of dismissal." The issue in Mimms was whether the People could instead appeal the dismissal to the appellate department of the superior court pursuant to section 1466. The exclusivity of one method of direct review is not inconsistent with alternative indirect remedies such as (1) accepting a first dismissal and commencing a permissible second prosecution by complaint or indictment, or (2) filing an information as permitted by section 739 which the defendant can challenge pursuant to section 995.

DISPOSITION
Let a peremptory writ of mandate issue directing the superior court to vacate its order of May 3, 1993, dismissing count 9 of the indictment as to *751 Martinez and Lopez, and to enter a new order denying dismissal of that count. The stay issued by this court on May 19, 1993, is to remain in effect until the superior court complies with the writ.
Woods (A.M.), P.J., and Epstein, J., concurred.
The petition of real parties in interest for review by the Supreme Court was denied January 20, 1994.
NOTES
[1]  All statutory references are to the Penal Code unless otherwise indicated.
[2]  Since the People may proceed either by information or by indictment (§ 737), the new (second) action could also be by indictment. (People v. Uhlemann (1973) 9 Cal.3d 662, 664, 669 [108 Cal. Rptr. 657, 511 P.2d 609].)
