pty 882 Posting Pro

Remember that UNION (and its cousins INTERSECT and EXCEPT) essentially require each of the provided queries to be run separately and the results collated. In this example (using PostgreSQL, but the same applies in MySQL), we can see exactly what's happening.

I have a small table with some users and their favourite colours:

peter=# select * from users;
┌────┬─────────┬──────────────────┐
│ id │  name   │ favourite_colour │
├────┼─────────┼──────────────────┤
│  3 │ Francis │ blue             │
│  4 │ Toby    │ blue             │
│  1 │ Joey    │ red              │
│  2 │ Dwayne  │ purple           │
└────┴─────────┴──────────────────┘
(4 rows)

Time: 0.400 ms

Now, let's say we want all users with a favourite colour of blue or red; if we use a UNION the following happens:

peter=# explain select name from users where favourite_colour = 'blue' union select name from users where favourite_colour = 'red' ;
┌───────────────────────────────────────────────────────────────────────────┐
│                                QUERY PLAN                                 │
├───────────────────────────────────────────────────────────────────────────┤
│ HashAggregate  (cost=35.33..35.39 rows=6 width=58)                        │
│   Group Key: users.name                                                   │
│   ->  Append  (cost=0.00..35.31 rows=6 width=58)                          │
│         ->  Seq Scan on users  (cost=0.00..17.62 rows=3 width=58)         │
│               Filter: ((favourite_colour)::text = 'blue'::text)           │
│         ->  Seq Scan on users users_1  (cost=0.00..17.62 rows=3 width=58) │
│               Filter: ((favourite_colour)::text = 'red'::text)            │
└───────────────────────────────────────────────────────────────────────────┘
(7 rows)

Time: 3.868 ms

As you can see, the query plan involves

  • two sequental scans (Seq Scan) that each perform a Filter,
  • an Append operation which is actually performing the UNION,
  • plus Group Key and HashAggregate steps, from which the resulting recordset can be returned.
pty 882 Posting Pro

This should help explain the differences between UNIX and Linux.

alaa sam commented: thanks alot +0
pty 882 Posting Pro

id is your primary key so it is already indexed

mysql> show indexes from artikulli;
pty 882 Posting Pro

i already installed ruby and in ruby directory contain fxri and Scite.
well, i m do small ex in fxri...
what is Scite for? what different about fxri and Scite? why i can't compile code in Scite?
i find compile in tools of Scite but it was disable.
example i write code in Scite :

5.times { print "Odelay!" }

when i tried to compiled i can't do this perform. there are compile, Build,Go etc in tools option that i cannot perform to click, it was disable. i m confused.
But this code running great in fxri. so why i can't do compiled in Scite?
please help

Thank you.

Did your source file definitely have a .rb extension? Did anything at all appear in the output window?

Jx_Man commented: Thank You For Directing friend :) +7
pty 882 Posting Pro

How to fastening inserting data on mysql???
I have 5000 record in excels. And I want to insert all record to mysql.. and it take time abaout 6 six minutes.. How to fastening become under 20 second to insert all 5000 records??

Peace

DODOl

Also you may want to temporarily stop using indexes on the tables in question

stymiee commented: good suggestion +7
pty 882 Posting Pro

I didn't see this thread sooner and it may now be too late, but 1 database is the way to go; easier to manage, easier to optimise, easier to backup, faster, requires less disk space.. 1 database is better in every way.

Don't be worried about the number of rows in a database; they are designed to cope with large volumes of data.

iamthwee commented: good +10
pty 882 Posting Pro

Ok I'm getting there.

I have managed to get my printer to work, and I have got g++ and gcc working! Yay.

Before I try and get my graphics card working,how do I burn cds?:'(

Thanx

As jbennet says nautilus is fine for burning files. For burning ISOs and other stuff:

sudo apt-get install gnomebaker

You should already have Serpentine installed (for burning audio cds)

If gnomebaker doesn't float your boat you may wanna try K3B (Its KDE so apt will have to install quite a few other libraries on your machine to use it, but its a bit fancier than gnomebaker).

If you're on Feisty and have an nVidia or ATi card there's a utility to install the restricted drivers automagically. If you're on something older than Feisty I'd recommend you upgrade/reinstall - its worth it!

iamthwee commented: Thanx(thwee) +9
pty 882 Posting Pro

solaris is proper unix. Thats based on System V isnt it?

http://en.wikipedia.org/wiki/Single_UNIX_Specification#Compliance

John A commented: Thanks for the link --joeprogrammer +8
pty 882 Posting Pro

If you know your stuff nothing should phase you. If you don't know the answer to a question don't guess, just say you don't know. You'll look less of an idiot.

Questions that always get me are like "Why do you want to work for this company?"

"Erm.. money?"

pseudorandom21 commented: Those questions get me too, man. +6
pty 882 Posting Pro

Ever thought of going to Kismet's website and clicking on the "downloads" page?

But that would mean him actually doing something!

John A commented: :cheesy: -joeprogrammer +5
pty 882 Posting Pro

I'm currently trying to create a program in delphi to call up a webpage; the page is written in php and records some data about its contents for record-keeping in my system. I'd like to be able to write the program so that when it opens it does the following:

1. Opens the webpage. I can do this, I found the code to open an application via ShellApi some time ago and it works just as well for a web url as for a file path.

2. Closes the webpage. I only really need to run the page once to do the job, and if the program can close the page afterwards it should. Again, I found some code on how to do this, so that's not really a problem, although I may need to build in a delay; as currently written, it doesn't like to close the page. This isn't critical though, it's merely my own personal aesthetics.

3. Closes the program itself. I know you can close a program with a single form (all this one has) by using the form.close procedure, except that this doesn't work when the statement is included in the form.formcreate procedure, and that's where I'm hoping to call it from.

Is it even possible to code my program so it fits this set of instructions, or should I start looking for a workaround?

Thanks in advance,
-EnderX

application.terminate;
EnderX commented: Quick response, accurate information. Quite nice. +1
pty 882 Posting Pro

Hi,
How to convert excel to html in shell prompt
Is there any unix command to do this ? so that I can use that in excel
Vinay

install gnumeric

then use ssconvert

should be something along the lines of:

ssconvert -I Gnumeric_Excel:excel -T Gnumeric_html:html40 file.xls
file.html

sut commented: excellent, i hadn't heard of this before +1