It's quicker to pass variable via a URL string than accessing a database, for the simple reason that you're avoiding the added overhead of connecting to the database, and running the query.
However, passing the variables via the url is difficult to maintain, for example, you might configure 5 different pages to send var1 and var2 to page1.php for processing, but what if you decide later n that you need a 3rd var, var3. Instead of just changing page1.php to handle it, you have to find every page that passes variables to it for them to change.
Therefore it's best practice to just pass the id to the script, and then query the database.. and with modern databases like MySQL, you will hardly notice the time difference.
Regards,
Kelvin